c#怎么获取当前程序的路径

在C#中,可以使用System.AppDomain.CurrentDomain.BaseDirectory属性来获取当前程序的路径。示例如下:

string currentPath = System.AppDomain.CurrentDomain.BaseDirectory;
Console.WriteLine(currentPath);

这样就可以获取到当前程序的路径并输出到控制台。

阅读剩余
THE END