我看到有一些方法可以获取应用程序文件夹路径:
Application.StartupPathSystem.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().Location)AppDomain.CurrentDomain.BaseDirectorySystem.IO.Directory.GetCurrentDirectory()Environment.CurrentDirectorySystem.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)System.IO.Path.GetDirectory(Application.ExecutablePath)取决于具体情况,最好的方法是什么?
我想将当前目录设置为解决方案diretory /配置名称.我怎么做?我可以用某种方式使用全局变量吗?
编辑:我正在尝试读取文件,当前目录在代码中间发生变化.我想改回来.