我的应用程序需要,我可以访问文件系统。不管在code Web服务器或一个控制台应用程序上运行,我如何能得到根目录下的应用程序运行在类似于C:\ TheApplication ...
My application requires that I have access to the file system. Regardless if the code runs on a web server or a console app, how can I get the root directory the application is running in. Something like C:\TheApplication...
谢谢!
最简单的大概是:
System.Reflection.Assembly.GetExecutingAssembly().Location
希望这有助于
Hope this helps,
-Oisin