💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
``` public class PropsTest { public static void main(String[] args)throws Exception{ File f = new File(System.getProperty("user.dir")+"\\test.txt");//这个路径名称根据具体情况 Properties p = new Properties(); p.load(new FileInputStream(f)); System.out.println(p.getProperty("A")); System.out.println(p.getProperty("B")); } } ``` test.txt中内容 ``` A=this is A B = this is B ``` 输出是: ``` this is A this is B ``` 说明前面多一些空格也么有关系。而第一个字符不能为空格。