properties读取

2015-02-26 0 521
properties读取
import java.io.IOException;  
import java.io.InputStream;  
import java.util.Properties;  
  
public class readproperties {  
      
    public static void main(String[] args) {  
        //配置文件放在src下  
        InputStream inStream= (InputStream) readproperties.class.getClassLoader().  
            getResourceAsStream("ApplicationResources.properties");//.ApplicationResources.properties  
              
        Properties properties=new Properties();  
        try {  
            properties.load(inStream);  
        } catch (IOException e) {  
              
            e.printStackTrace();  
        }  
        String value=properties.getProperty("key");  
        System.out.println("getProperty...................."+value);  
    }  
}  

遇见资源网 java properties读取 http://www.ox520.com/8537.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务