• C#创建后台服务注意事项


    前端时间自己学习整了个小小的后台服务,比较需要注意的是在install.cs中要添加一个serviceInstaller和serviceProcessInstaller

     private void InitializeComponent()
            {
                //components = new System.ComponentModel.Container();
                this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
                this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
                // 
                // serviceInstaller1
                // 
                this.serviceInstaller1.Description = "Stest测试服务";
                this.serviceInstaller1.DisplayName = "Stest测试服务";
                this.serviceInstaller1.ServiceName = "Stest测试服务";
                this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
                // 
                // serviceProcessInstaller1
                // 
                this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalService;
                this.serviceProcessInstaller1.Password = null;
                this.serviceProcessInstaller1.Username = null;
                // 
                // ProjectInstaller
                // 
                this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceInstaller1,
                this.serviceProcessInstaller1});
    
            }
    
            #endregion
    
            private System.ServiceProcess.ServiceInstaller serviceInstaller1;
            private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
    
    EXEC dbo.success '坚持','细心','计划'
  • 相关阅读:
    Xpath注入攻击及其防御技术研究
    警言201003
    linux命令0423
    tomcat 和myeclipse 怎么不和谐啊
    JAVA环境变量
    笑话201003
    linux 下安装qt
    Myeclipse,tomcat
    惜福
    Windows 下用reg 文件将exe 写入启动项
  • 原文地址:https://www.cnblogs.com/weeky/p/2151784.html
Copyright © 2020-2023  润新知