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

   2024-11-01 4720
核心提示:在C#中,可以使用System.AppDomain.CurrentDomain.BaseDirectory属性来获取当前程序的路径。示例如下:string currentPath = Sys

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

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

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

 
举报打赏
 
更多>同类维修知识
推荐图文
推荐维修知识
点击排行

网站首页  |  关于我们  |  联系方式  |  用户协议  |  隐私政策网站留言    |  赣ICP备2021007278号