.net Core 获取网站目录

就一句话

 var path = AppContext.BaseDirectory;

生成文件就几句话

StreamWriter sw = new StreamWriter(path + "123.json");
sw.Write("hahhaha");
sw.Close();

猜你喜欢

转载自www.cnblogs.com/Extnet/p/9916005.html