xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

csharp-Windows服務(wù)及進(jìn)程監(jiān)控程序,可以設(shè)定要監(jiān)控的進(jìn)程和服務(wù)名稱,監(jiān)控到?jīng)]運(yùn)行自動(dòng)啟動(dòng).服務(wù)監(jiān)控,進(jìn)程監(jiān)控

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Diagnostics;
using?System.IO;
using?System.Linq;
using?System.Text;
using?System.Threading;
using?System.Threading.Tasks;
using?log4net;

namespace?HQ.ServiceWatch
{
????public?class?ProcessWatcher
????{
????????static?readonly?ILog?_log?=?LogManager.GetLogger(“TraceLogFileAppender“);
????????//字段
????????public?string[]?_processAddress;
????????public?int?WaitSeconds;

????????///?
????????///?開始監(jiān)控
????????///?

????????public?void?StartWatch()
????????{
????????????if?(this._processAddress?!=?null)
????????????{
????????????????if?(this._processAddress.Length?>?0)
????????????????{
????????????????????foreach?(string?str?in?_processAddress)
????????????????????{
????????????????????????if?(str.Trim()?!=?““)
????????????????????????{
????????????????????????????if?(File.Exists(str.Trim()))
????????????????????????????{
????????????????????????????????this.ScanProcessList(str.Trim());
????????????????????????????}
????????????????????????}
????????????????????}
????????????????}
????????????}
????????}

????????///?
????????///?掃描進(jìn)程列表,判斷進(jìn)程對應(yīng)的全路徑是否與指定路徑一致
????????///?如果一致,說明進(jìn)程已啟動(dòng)
????????///?如果不一致,說明進(jìn)程尚未啟動(dòng)
????????///?

????????///?
????????private?void?ScanProcessList(string?address)
????????{
????????????Process[]?arrayProcess?=?Process.GetProcesses();
????????????foreach?(Process?p?in?arrayProcess)
????????????{
????????????????//System、Idle進(jìn)程會(huì)拒絕訪問其全路徑
????????????????if?(p.ProcessName?!=?“System“?&&?p.ProcessName?!=?“Idle“)
????????????????{
????????????????????try
????????????????????{
????????????????????????if?(this.FormatPath(address)?==?this.FormatPath(p.MainModule.FileName.ToString()))
????????????????????????{
????????????????????????????//進(jìn)程已啟動(dòng)
????????????????????????????this.WatchProcess(p?address?WaitSeconds);
????????????????????????????return;
????????????????????????}
????????????????????}
????????????????????catch
????????????????????{
????????????????????????//拒絕訪問進(jìn)程的全路徑
????????????????????????//_log.Info(“進(jìn)程(“?+?p.Id.ToString()?+?“)(“?+?p.ProcessName.ToString()?+?“)拒絕訪問全路徑!“);
????????????????????}
????????????????}
????????????}

????????????//進(jìn)程尚未啟動(dòng)
????????????Process?process?=?new?Process();
????????????process.StartInfo.FileName?=?address;
????????????process.Start();
????????????this.WatchProcess(process?address?WaitSeconds);
????????}


????????///?
????????///?監(jiān)聽進(jìn)程
????????///?

????????///?
????????///?
????????private?void?WatchProcess(Process?process?string?address?int?waitSeconds)
????????{
????????????ProcessRestart?objProcessRestart?=?new?ProcessRestart(process?address?waitSeconds);
????????????Thread?thread?=?new?Thread(new?ThreadStart(objProcessRestart.RestartProcess));
????????????thread.Start();
????????}


??

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件????????605??2015-04-02?17:56??HQ.ServiceWatch\HQ.ServiceWatch\App.config

?????文件??????13312??2015-04-02?17:54??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\HQ.ServiceWatch.exe

?????文件????????605??2015-04-02?17:49??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\HQ.ServiceWatch.exe.config

?????文件??????32256??2015-04-02?17:54??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\HQ.ServiceWatch.pdb

?????文件??????24224??2015-04-02?17:55??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\HQ.ServiceWatch.vshost.exe

?????文件????????605??2015-04-02?17:49??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\HQ.ServiceWatch.vshost.exe.config

?????文件??????????0??2015-04-02?15:26??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\log\error.txt

?????文件???????2281??2015-03-13?16:26??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\log4net.config

?????文件?????301056??2015-04-02?14:32??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\log4net.dll

?????文件????1517265??2015-04-02?14:32??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\log4net.xml

?????文件???????1321??2015-04-02?17:52??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\Logs\20150402.log

?????文件?????279040??2015-04-02?14:33??HQ.ServiceWatch\HQ.ServiceWatch\bin\Debug\Topshelf.dll

?????文件??????12800??2015-04-02?17:55??HQ.ServiceWatch\HQ.ServiceWatch\bin\Release\HQ.ServiceWatch.exe

?????文件????????605??2015-04-02?17:49??HQ.ServiceWatch\HQ.ServiceWatch\bin\Release\HQ.ServiceWatch.exe.config

?????文件??????26112??2015-04-02?17:55??HQ.ServiceWatch\HQ.ServiceWatch\bin\Release\HQ.ServiceWatch.pdb

?????文件??????24224??2015-04-02?17:55??HQ.ServiceWatch\HQ.ServiceWatch\bin\Release\HQ.ServiceWatch.vshost.exe

?????文件????????605??2015-04-02?17:49??HQ.ServiceWatch\HQ.ServiceWatch\bin\Release\HQ.ServiceWatch.vshost.exe.config

?????文件????????490??2010-03-17?22:39??HQ.ServiceWatch\HQ.ServiceWatch\bin\Release\HQ.ServiceWatch.vshost.exe.manifest

?????文件?????301056??2015-04-02?14:32??HQ.ServiceWatch\HQ.ServiceWatch\bin\Release\log4net.dll

?????文件????1517265??2015-04-02?14:32??HQ.ServiceWatch\HQ.ServiceWatch\bin\Release\log4net.xml

?????文件?????279040??2015-04-02?14:33??HQ.ServiceWatch\HQ.ServiceWatch\bin\Release\Topshelf.dll

?????文件???????3159??2015-04-02?17:56??HQ.ServiceWatch\HQ.ServiceWatch\HQ.ServiceWatch.csproj

?????文件???????2281??2015-04-02?17:56??HQ.ServiceWatch\HQ.ServiceWatch\log4net.config

?????文件???????7249??2015-04-02?14:52??HQ.ServiceWatch\HQ.ServiceWatch\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

?????文件????????854??2015-04-02?17:55??HQ.ServiceWatch\HQ.ServiceWatch\obj\Debug\HQ.ServiceWatch.csproj.FileListAbsolute.txt

?????文件??????14319??2015-04-02?15:07??HQ.ServiceWatch\HQ.ServiceWatch\obj\Debug\HQ.ServiceWatch.csprojResolveAssemblyReference.cache

?????文件??????13312??2015-04-02?17:54??HQ.ServiceWatch\HQ.ServiceWatch\obj\Debug\HQ.ServiceWatch.exe

?????文件??????32256??2015-04-02?17:54??HQ.ServiceWatch\HQ.ServiceWatch\obj\Debug\HQ.ServiceWatch.pdb

?????文件??????????0??2015-04-02?14:14??HQ.ServiceWatch\HQ.ServiceWatch\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

?????文件??????????0??2015-04-02?14:14??HQ.ServiceWatch\HQ.ServiceWatch\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

............此處省略65個(gè)文件信息

評論

共有 條評論

相關(guān)資源