properties.java

来自「一些Java写的测试API的源代码」· Java 代码 · 共 39 行

JAVA
39
字号
import java.util.*;
import java.io.*;
	public class Properties
	{
       

        public Properties()
	{
	resultRecord(100);	
	}	


	public void resultRecord(int score)
  	{
//    System.out.println("test-a");
         Properties pp = new Properties();
         try
         {
        pp.load(new FileInputStream("Miracle.ini"));
        Enumeration enumt= pp.propertyNames();
        while(enumt.hasMoreElements())
        {
                String name = (String)enumt.nextElement();
                String score_temp  = pp.getProperty(name);
                System.out.println(name+"="+score_temp);
        }
        }catch(Exception e)
        {
                System.out.println("Cannot find the file");
                System.out.println(e.getMessage());
    	}
 	}
  
	public static void main(String[] args)
	{
		new Properties();
	}
}

⌨️ 快捷键说明

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