获取完整路径,Windows服务路径、完整、Windows

由网友(若是凉夜已成梦)分享简介:我怎样才能找出Windows服务.exe文件是动态安装的文件夹?How can I find out the folder where the windows service .exe file is installed dynamically?Path.GetFullPath(relativePath);返回根据...

我怎样才能找出Windows服务.exe文件是动态安装的文件夹?

How can I find out the folder where the windows service .exe file is installed dynamically?

Path.GetFullPath(relativePath);

返回根据的路径C: WINDOWS SYSTEM32 目录

不过, XMLDocument.load方法(字符串文件名)的方法似乎是对工作在服务.exe文件的安装目录内的相对路径。

However, the XmlDocument.Load(string filename) method appears to be working against relative path inside the directory where the service .exe file is installed to.

推荐答案

尝试

System.Reflection.Assembly.GetEntryAssembly().Location
阅读全文

相关推荐

最新文章