zoukankan      html  css  js  c++  java
  • c# windows服务如何获取自己的安装路径

      public static string GetWindowsServiceInstallPath(string ServiceName)
            {
                string key = @"SYSTEMCurrentControlSetServices" + ServiceName;
                string path = Registry.LocalMachine.OpenSubKey(key).GetValue("ImagePath").ToString();
                //替换掉双引号   
                path = path.Replace(""", string.Empty);

                FileInfo fi = new FileInfo(path);
                return fi.Directory.ToString();
            }

  • 相关阅读:
    防抖函数
    video.js汉化
    vscode 设置
    webpack配置
    寄生组合继承
    数组排序
    操作节点的方法
    vscde软件
    vue目录详解
    前端
  • 原文地址:https://www.cnblogs.com/wuxl360/p/8032250.html
Copyright © 2011-2022 走看看