finding the actual executable and path associated to a windows service using c#

后端 未结 2 1568
再見小時候
再見小時候 2021-01-12 00:59

I am working on an installation program for one of my company\'s product. The product can be installed multiple times and each installation represents a separate windows ser

2条回答
  •  情歌与酒
    2021-01-12 01:05

    the interface has changed since @sidprasher answered, try:

    var collection = searcher.Get().Cast()
            .Where(mbo => mbo.GetPropertyValue("StartMode")!=null)
            .Select(mbo => Tuple.Create((string)mbo.GetPropertyValue("Name"), (string)mbo.GetPropertyValue("PathName")));
    

提交回复
热议问题