CurrentDirectory
C# 避免使用System.Environment.CurrentDirectory
我有一个程序A(exe)是通过计划任务程序启动,发现通过System.Environment.CurrentDirectory获取的路径不是程序A的运行目录,而是C:\Windows\System32 DirectoryInfo topDir = Directory.GetParent(System ......
C# Environment.CurrentDirectory和AppDomain.CurrentDomain.BaseDirectory的区别
Environment.CurrentDirectory 和 AppDomain.CurrentDomain.BaseDirectory 都是C#中用于获取当前应用程序的目录路径的方法,但是它们的用途和行为是不同的。 Environment.CurrentDirectory 返回的是当前进程的当前工 ......