在.net中设置Windows服务描述的最佳方法是什么 [英] What's the best way to set a windows service description in .net

查看:36
本文介绍了在.net中设置Windows服务描述的最佳方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用VS2005模板创建了C#服务.它可以正常工作,但是Windows Services控件小程序中的服务描述为空白.

I have created a C# service using the VS2005 template. It works fine however the description of the service is blank in the Windows Services control applet.

推荐答案

创建ServiceInstaller并设置描述

Create a ServiceInstaller and set the description

private System.ServiceProcess.ServiceInstaller serviceInstaller = 
  new System.ServiceProcess.ServiceInstaller();
this.serviceInstaller.Description = "Handles Service Stuff";

这篇关于在.net中设置Windows服务描述的最佳方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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