爱心技术专栏专题

ngandWritingaPropertiesFile(FromSu

摘录:java 来源:java 加入时间:2006年08月19日
摘要:
ngandWritingaPropertiesFile(FromSu
ng and Writing a Properties File(From Sun)
Reading and Writing a Properties File


// Read properties file.

Properties properties = new Properties();
try {
     properties.load(new Fil…

转载:转载请保留本信息,本文来自
http://www.51dibs.com
/html/2006/article/info14/a_cb31ccb8e7085d20.htm

ngandWritingaPropertiesFile(FromSu

站点:爱心种子小博士 关键字:ngandWritingaPro

   
ng and Writing a Properties File(From Sun)
Reading and Writing a Properties File


// Read properties file.

Properties properties = new Properties();
try {
     properties.load(new FileInputStream(
       "infilename"));
} catch (IOException e) {
}
     
// Write properties file.

try {
     properties.store(new FileOutputStream(
       "outfilename"), null);
} catch (IOException e) {
}


Here is an example of the contents of a properties file:
     # a comment
     ! a comment
     
     a = a string
     b = a string with escape sequences \t
              \n \r \\ \" \ \ (space) \u0123
     c = a string with a continuation line \
         contination line
     d.e.f = another string


客户服务中心信箱:[email protected] [email protected] 网站地图

声明

合作伙伴: