String configfile = "cfg/client.cfg"; // 读取配置文件账号密码 Properties props = new Properties(); InputStream in = new BufferedInputStream(new FileInputStream( configfile)); props.load(in); String userName = props.getProperty("userName"); String password = props.getProperty("passWord"); // 读取配置文件账号密码