proptest.java

来自「一些JavaAPI测试的源代码(包括一些Java中常用的数据结构类」· Java 代码 · 共 40 行

JAVA
40
字号
/**
 *Author Miracle
 *Time	2005.11.24 14:41
 *
 */
 
 import java.util.*;
 import java.io.*;
 
 public class PropTest
 {
 	public static void main(String [] args)
 	{
 		/*
 		Properties pps = System.getProperties();
 		pps.list(System.out);
 		*/
 		
 		Properties pps = new Properties();
 		try
 		{
 			pps.load(new FileInputStream("miracle.ini"));
 			Enumeration enumt = pps.propertyNames();
 			while(enumt.hasMoreElements())
 			{
 				String strkey = (String)enumt.nextElement();
 				String strValues = pps.getProperty(strkey);
 				System.out.println(strkey + "=" + strValues);
 				
 			}
 		}
 		catch(Exception e)
 		{
 			e.printStackTrace();
 		}
 		
 	}
 }
 
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?