?? srvinstaller.cs
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
namespace apolloService
{
/// <summary>
/// SrvInstaller 的摘要說明。
/// </summary>
[RunInstaller(true)]
public class SrvInstaller : System.Configuration.Install.Installer
{
/// <summary>
/// 必需的設計器變量。
/// </summary>
private System.ComponentModel.Container components = null;
private System.ServiceProcess.ServiceProcessInstaller spInstaller;
private System.ServiceProcess.ServiceInstaller sInstaller;
public SrvInstaller()
{
// 該調用是設計器所必需的。
InitializeComponent();
// TODO: 在 InitializeComponent 調用后添加任何初始化
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region 組件設計器生成的代碼
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
// 創建ServiceProcessInstaller對象和ServiceInstaller對象
this.spInstaller = new System.ServiceProcess.ServiceProcessInstaller();
this.sInstaller = new System.ServiceProcess.ServiceInstaller();
// 設定ServiceProcessInstaller對象的帳號、用戶名和密碼等信息
this.spInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
this.spInstaller.Username = null;
this.spInstaller.Password = null;
// 設定服務名稱
this.sInstaller.ServiceName = "ApolloMsgSrv";
// 設定服務的啟動方式
this.sInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
this.Installers.AddRange(new System.Configuration.Install.Installer[] {this.spInstaller, this.sInstaller });
}
#endregion
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -