您的位置:首页 > 编程语言 > C#

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: