用VS制作的windows服务安装包 安装完后如何让服务自动启动
vs 服务做成安装包,如何安装以后启动服务,只要在类名为projectinstaller的类中重写commit事件即可
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
ServiceController sc = new ServiceController("HttpProviderService");
if (sc.Status.Equals(ServiceControllerStatus.Stopped))
{
sc.Start();
}
}
{
base.Commit(savedState);
ServiceController sc = new ServiceController("HttpProviderService");
if (sc.Status.Equals(ServiceControllerStatus.Stopped))
{
sc.Start();
}
}
龙腾一族至尊龙骑