C#创建后台服务注意事项
2011-08-24 11:47
225 查看
前端时间自己学习整了个小小的后台服务,比较需要注意的是在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;
相关文章推荐
- Jquery调用C#后台方法注意事项
- 创建一个windows服务的小程序及注意事项
- Jquery调用C#后台方法注意事项
- 使用javascript比较数字大小和引用C#后台变量的注意事项
- linux下后台启动weblogic服务(还有些注意事项)
- c# 系统服务更改服务名称及部署注意事项
- C# 中如何操作系统服务?注意事项有哪些?给出代码片段!(图)
- C# windows服务 的注意事项
- VMware中安装ArcGIS10.3 For Server并发布服务注意事项
- 【转载】C#扫盲之:带你掌握C#的扩展方法、以及探讨扩展方法的本质、注意事项
- C# 如何创建一个Windows服务
- 在服务中创建用户进程的方法(C#版)
- linux 创建ftp的几个注意事项(以vsftpd为例)
- C#操作Xml的注意事项
- 包含别人的dll,然后我们用类库再次封装成dll的时候的注意事项;源文件与模块生成时的文件不同;创建调试信息文件 ··PDB时发生意外的错误,进程无法访问文件,因为另一个程序正在使用此文件
- c#编写高性能Tcp Socket应用注意事项
- sourceIsight创建大量工程时的注意事项
- Oracle10g修改安装 和 Oracle数据库卸载 和 Oracle服务项批处理命令 和 注意事项
- 【开发管理类软件必备知识视频教程之二】登录窗体后台注意事项
- opencv Mat创建注意事项