代码之家  ›  专栏  ›  技术社区  ›  wonea Ilya Smagin

如何找到服务的安装位置?C.*

  •  0
  • wonea Ilya Smagin  · 技术社区  · 15 年前

    是否可以通过.NET查找安装服务的位置?

    var temp = from sc in ServiceController.GetServices()
    where sc.ServiceName == "MSSQL$SQLEXPRESS"
    select sc;
    

    但是,ServiceController没有提供我想要的路径,特别是在“服务属性”对话框中找到的“执行路径”。

    1 回复  |  直到 15 年前
        1
  •  1
  •   Andrei Schneider    15 年前

    我用过这个 code