WCF服务 自动启动设置代码

View Code
 1         public ProjectInstaller()
 2         {
 3             InitializeComponent();
 4             this.Committed += new InstallEventHandler(ProjectInstaller_Committed);
 5         }
 6 
 7         private void ProjectInstaller_Committed(object sender, InstallEventArgs e)
 8         {
 9             System.ServiceProcess.ServiceController controller = new System.ServiceProcess.ServiceController("VAV_SERVICE");
10             controller.Start();
11         }

 

posted @ 2012-05-24 02:41  石 磊  阅读(572)  评论(0编辑  收藏  举报