C# 系统服务添加安装
2010-05-15 12:37
351 查看
Installer1.cs
Code
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Diagnostics;
6 using System.ServiceProcess;
7 using System.Text;
8
9 namespace WindowsService1
10 {
11 public partial class Service1 : ServiceBase
12 {
13 public Service1()
14 {
15 InitializeComponent();
16 }
17
18 protected override void OnStart(string[] args)
19 {
20 // TODO: 在此处添加代码以启动服务。
21 this.EventLog.WriteEntry("AAAAAAAAAAAAAAAAAAAAAAAAAAAA", EventLogEntryType.Information);
22 }
23
24 protected override void OnStop()
25 {
26 // TODO: 在此处添加代码以执行停止服务所需的关闭操作。
27
28
29 }
30 }
31 }
32
Code
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Diagnostics;
6 using System.ServiceProcess;
7 using System.Text;
8
9 namespace WindowsService1
10 {
11 public partial class Service1 : ServiceBase
12 {
13 public Service1()
14 {
15 InitializeComponent();
16 }
17
18 protected override void OnStart(string[] args)
19 {
20 // TODO: 在此处添加代码以启动服务。
21 this.EventLog.WriteEntry("AAAAAAAAAAAAAAAAAAAAAAAAAAAA", EventLogEntryType.Information);
22 }
23
24 protected override void OnStop()
25 {
26 // TODO: 在此处添加代码以执行停止服务所需的关闭操作。
27
28
29 }
30 }
31 }
32
相关文章推荐
- fedora 16 yum安装mysql后怎样启动,以及添加为系统服务
- fedora 16 yum 安装mysql后怎样启动,以及添加为系统服务
- MySql5.7在Windows系统中的安装、修改root密码、添加到系统服务
- fedora 16 yum 安装mysql后怎样启动,以及添加为系统服务,但不能开机启动
- Linux 源码安装php 把php-fpm添加为系统服务
- C# 实现安装C#写的系统服务 不依赖InstallUtil
- linux源码安装服务添加为系统服务
- 为c#服务添加安装程序【转载】
- 编译安装apache 以及 添加系统服务
- C# windows 服务添加安装程序。
- yum 安装mysql后怎样启动,以及添加为系统服务,但不能开机启动
- CentOS系统编译安装服务如何添加开机自启动
- c# 系统服务程序安装
- Nginx(一)编译安装及添加为系统服务
- C#Windows服务工程添加安装程序的方法
- window安装mongodb无法添加到系统服务
- centos 7 编译安装 mysql 及 添加 mysql 到系统服务
- 《Windows小应用》如何将一个自己download的zip文件安装的程序添加到系统服务中
- cengos 安装redis 并将redis启动添加为系统服务
- centos 7 编译安装nginx 及添加 nginx 到系统服务