windows 服务获取安装路径

通过运行的动态库地址获取

//获取运行的动态库地址,包括 动态库名称 如:D:\Program File\xxx\xxx.dll
string strAssemblyFilePath = Assembly.GetExecutingAssembly().Location;
//根据dll名称,获取对应文件夹路径(去掉动态库名称)
string AppPath = Path.GetDirectoryName(strAssemblyFilePath)

  

posted @ 2014-07-21 09:46  人来人往  阅读(369)  评论(0)    收藏  举报