加载当前类路径下的 properties 文件
Properties properties = new Properties(); // 使用ClassLoader加载properties配置文件生成对应的输入流 InputStream in = 当前类名.class.getClassLoader().getResourceAsStream("emailConfig.properties"); // 使用properties对象加载输入流 properties.load(in); //获取key对应的value值 account=properties.getProperty("account"); password=properties.getProperty("password");