System.Environment.SystemDirectory ;C:/windows/system32目录 最后贴出我进行上面操作获得的变量值,事先说明,本人是编写了一个WinForm程序,项目文件存放于D:\Visual Studio Projects\MyApplication\LifeAssistant,编译后的文件位于D:\Visual Studio Projects\MyApplication\LifeAssistant\bin\Debug,最后的结果如下:
1、System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName=D:\Visual Studio Projects\MyApplication\LifeAssistant\bin\Debug\LifeAssistant.exe
2、System.Environment.CurrentDirectory=D:\Visual Studio Projects\MyApplication\LifeAssistant\bin\Debug
3、System.IO.Directory.GetCurrentDirectory()=D:\Visual Studio Projects\MyApplication\LifeAssistant\bin\Debug 1 asp.net webform用“