通过变量设置ServiceInstaller的DisplayName [英] Set DisplayName for ServiceInstaller by variable

查看:201
本文介绍了通过变量设置ServiceInstaller的DisplayName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友
我想通过变量设置DisplayName属性,所以当我想更改它时,我可以动态地设置它.
我该怎么做?
例如 DisplayName = @%SystemRoot%\ system32 \ umpnpmgr.dll,-100

该字符串提供即插即用"功能.

Dear Friends
i Want to set DisplayName Property by variable, So when i want to change it i can dynamically.
How can i do that task?
for eg.
DisplayName=@%SystemRoot%\system32\umpnpmgr.dll,-100

This string Provide "Plug And Play" for that service.

推荐答案

,您可以使用Process类执行带有命令行参数的程序集,并从中获取服务名称,然后将结果值设置为服务名称

有关更多信息,请 http://msdn.microsoft.com/en-us/library/system .diagnostics.process.aspx [ ^ ]

希望这会有所帮助:)

贾斯(Jas)
you can use the Process class to execute an assembly with commandline args and get the service name out of it, then set the result value to the service name

for more info http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^]

Hope this helps :)

Jas


这篇关于通过变量设置ServiceInstaller的DisplayName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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