标签:strong inf print get soc 文件 class .class string
public class Client {
/**
* socket的连接参数属性文件
*/
private final String propFile = "/com/coruninfo/zs/tax/banksocket/handler/client.properties";//属性文件地址
Properties prop = new Properties();
InputStream input = Client.class.getResourceAsStream(propFile);//Client.class是当前类名
prop.load(input);
String IP = prop.getProperty("ip");
int PORT = Integer.parseInt(prop.getProperty("port"));
int TIMEOUT = Integer.parseInt(prop.getProperty("timeOut"));
System.out.println(IP + " , " + PORT + " , " + TIMEOUT);
}
标签:strong inf print get soc 文件 class .class string
原文地址:http://www.cnblogs.com/jzhxhs/p/7826526.html