標籤:2.0 wss 視圖 stop 輸入 esc 目錄 framework 校訊通
建立一個Windows服務
http://jingyan.baidu.com/article/fa4125acb71a8628ac709226.html
安裝服務
使用FramWork架構內建的InstallUtil.exe工具安裝服務
一般使用命令列安裝服務,快捷速度
InstallUtil位置:C:\Windows\Microsoft.NET\Framework\
不同版本所在目錄不同,framework2.0在v2.0.50727目錄下
方式一:
以管理員身份運行cmd輸入
C:\Windows\Microsoft.NET\Framework\v4.0.30319.InstallUtil.exe E:\TestApp\Winform\WinServiceTest\WinServiceTest\bin\Debug\WinServiceTest.exe 斷行符號即可安裝服務
方式二:
Dat檔案:
%~dp0InstallUtil.exe %~dp0WindowsServiceForWCFDemo.exe
pause
命令列學習:cd 進入目錄 cd..退出目錄 pause 暫停 %~dp0目前的目錄 start開始
Windows指令碼bat檔案
卸載
方式一:
Dat檔案刪除:
%~dp0InstallUtil.exe /uninstall %~dp0WindowsServiceForWCFDemo.exe
pause
方式二:
以管理員身份運行cmd,輸入sc delete 服務名
服務在資源管理員的服務名是ServiceName 描述是DisplayName
在服務裡是服務名是DisplayName 描述是DescribeName
開啟服務:net start xxt_service
關閉服務:net stop xxt_service
在設計檢視點擊右鍵,選擇“添加安裝程式”,新增serviceProcessInstaller1和serviceInstaller1兩個組件。
serviceProcessInstaller1屬性設定如下:
Account : localsystem 表示所有使用者均可使用本服務。
serviceInstaller1屬性設定如下:
Description:校訊通類比話機定時檢測服務 表示將要出現在windows服務管理員中的服務描述。
Displayname:xxt_service 表示將要顯示在windows服務管理員中的服務名稱。
使用
http://www.cnblogs.com/jiewei915/archive/2010/12/14/1905395.html
一次安裝兩個服務
Windows服務的安裝、卸載