zoukankan      html  css  js  c++  java
  • 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 '坚持','细心','计划'
  • 相关阅读:
    正则表达式语法介绍
    关系型数据库和非关系型数据库的简单对比
    lambda函数
    java基础系列--Exception异常处理
    springBoot基础系列--properties配置
    spring基础系列--JavaConfig配置
    java基础系列--Calendar类
    java基础系列--Date类
    一个特殊的List去重问题的解决方案
    Java学习笔记
  • 原文地址:https://www.cnblogs.com/weeky/p/2151784.html
Copyright © 2011-2022 走看看