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