摘要: 1.新建一个windows服务项目WatchPC,打开此服务项目(组件)的【视图设计器】,右键【视图设计器】,打开【属性】选项卡,设置<ServiceName>服务名称为WatchPC。2.WatchPC的OnStart里面写入服务启动后要执行的代码3.OnStop里面写入服务停止后要执行的代码4.右键单击WatchPC的视图设计器,单击【添加安装程序】,VS会在项目里自动添加ProjectInstaller.cs项目,此项目为安装windows服务所必须项目。5.打开ProjectInstaller项目(组件)的【视图设计器】,可以看到serviceInstaller1和serv 阅读全文
posted @ 2012-02-28 16:14 RyanCheng 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 发送消息的类:/// <summary> /// 发送消息 /// </summary> public class UdpSendMessage { System.Net.Sockets.UdpClient udpClient = null; public static int BufferSize = 1024; public UdpSendMessage() { udpClient = new System.Net.Sockets.UdpClient(); } ... 阅读全文
posted @ 2012-02-28 10:04 RyanCheng 阅读(248) 评论(0) 推荐(0) 编辑