Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好,在 c# 上创建文本文件时我应该指定什么路径。
我希望它放在我的应用程序的安装文件夹中。
因为我有这样的代码。
System.IO.StreamWriter file = new System.IO.StreamWriter("what path to put?");
这将为您提供安装应用程序的目录的路径。(程序集所在的位置)
string path = AppDomain.CurrentDomain.BaseDirectory;
请参考Application.StartupPath