• java配置文件读取


    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.util.Properties;
    
    //属性文件操作类
    public class ServerConfig {
    
        private static Properties p = new Properties();
        static {
            try {
                p.load(new FileInputStream("./server.ini"));
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                System.out.println("服务器加载配置文件出错!");
            }
        }
    
        public static String getValue(String key) {
            return p.getProperty(key);
        }
    }
    server_port=8211
    action_server_port=8212
    file_server_port=8213
    output_amr_path=d:/amr
    output_image_path=d:/image
    
    database.driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
    database.url=jdbc:sqlserver://localhost:1433;DatabaseName=hyhd
    database.username=sa
    database.password=
  • 相关阅读:
    python
    python
    python
    python
    python 序列化
    字典
    异常处理
    类的成员,类的特殊方法
    HTMLEditor类常用方法说明
    HTMLEditor类常用属性说明
  • 原文地址:https://www.cnblogs.com/ErrStr/p/6347609.html
Copyright © 2020-2023  润新知