如何获得服务的可执行文件路径 [英] How to get service executable file path

查看:276
本文介绍了如何获得服务的可执行文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有反正获得运行Windows服务的可执行文件的路径,而无需在.net管理员执行级别权限? (没有使所述UAC获得用户的确认)

解决方案

  Path.GetDirectoryName(Assembly.GetExecutingAssembly()。地点)
 

Is there anyways to get the executable file path of a running Windows service without requiring administrator execution level privilege in .Net? (Without causing the UAC to get the user's confirmation)

解决方案

Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)

这篇关于如何获得服务的可执行文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆