如何获得服务的可执行文件路径如何获得、可执行文件、路径

2023-09-04 05:23:33 作者:余厌

有没有反正获得运行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)

解决方案 windows服务修改可执行文件路径

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