Take the content in the resource file!

xiaoxiao2021-03-06  15

Import java.util.missingResourceException; import java.util.resourcebundle;

Public class test {

// Resource File Name Private Static String Configuration_FileName = "gemplanet"; // Want to get the keyprivate static string key = "filetype";

Public static void main (String [] args) {

String value = (string) getENVIRONMENTVARIABLE (KEY); system.out.println (value);}

private static String getEnvironmentVariable (String key) {try {ResourceBundle bundle = ResourceBundle.getBundle (CONFIGURATION_FILENAME); return bundle.getString (key);} catch (MissingResourceException e) {return null;}

}

转载请注明原文地址:https://www.9cbs.com/read-45822.html

New Post(0)