public Dictionary <string, string> Get() { System.IO.File.WriteAllTextAsync("./Test.txt", "Hello");//当前类文件所在的目录 return(new Dictionary <string, string> { { "Directory.GetCurrentDirectory()", Directory.GetCurrentDirectory() }, //当前类文件所在的目录 { "AppDomain.CurrentDomain.BaseDirectory", AppDomain.CurrentDomain.BaseDirectory }, //当前执行程序集(dll或exe)所在目录 { "IWebHostEnvironment", _env.AsJsonStr() } }); }