Asp.net源码专业站
首页->尚未分类->BugTrack51aspx汉化改造版V2.1.7>>btnet_service.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:BugTrack51aspx汉化改造版V2.1.7
当前文件:文件类型 14RFAMJDWSL814/btnet_service.cs[1K,2009-6-12 11:30:42]打开代码结构图
普通视图
		            
1using System; 2//compile like so: 3//csc btnet_service.cs POP3Main.cs POP3Client.cs 4 5//then run "installutil.exe" 6 7using System.ComponentModel; 8using System.Configuration.Install; 9 10namespace btnet { 11 12 /////////////////////////////////////////////////////////////////////// 13 public class service : System.ServiceProcess.ServiceBase 14 { 15 16 protected static POP3Main pop3; 17 18 public static void Main (string[] args) 19 { 20 System.ServiceProcess.ServiceBase.Run(new service()); 21 } 22 23 24 public service() 25 { 26 this.ServiceName = "btnet_service"; 27 this.CanStop = true; 28 this.CanPauseAndContinue = true; 29 this.AutoLog = true; 30 } 31 32 33 protected override void OnStart(string[] args) { 34 bool verbose = false; 35 pop3 = new POP3Main("c:\\btnet_service.exe.config", verbose); 36 } 37 protected override void OnStop() { 38 pop3.pause(); 39 } 40 protected override void OnPause() { 41 pop3.pause(); 42 } 43 protected override void OnContinue() { 44 pop3.resume(); 45 } 46 47 } 48 49 [RunInstaller(true)] 50 public class ProjectInstaller : System.Configuration.Install.Installer 51 { 52 53 private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1; 54 private System.ServiceProcess.ServiceInstaller serviceInstaller1; 55 56 public ProjectInstaller() 57 { 58 59 this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller(); 60 this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller(); 61 this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem; 62 this.serviceProcessInstaller1.Password = null; 63 this.serviceProcessInstaller1.Username = null; 64 65 this.serviceInstaller1.ServiceName = "btnet_service"; 66 67 this.Installers.AddRange( 68 new System.Configuration.Install.Installer[] { 69 this.serviceProcessInstaller1, 70 this.serviceInstaller1} 71 ); 72 73 74 } 75 76 } 77 78}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:BugTrack51aspx汉化改造版V2.1.7
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146