12 2012 档案
启动和停止一个服务,修改服务的启动类型 Start and Stop Service for windows
摘要:public void PreTest() { SetServiceLaunch(); //修改服务的启动类型 ServiceController sc = new ServiceController("GFIProxy"); if ((sc.Status.Equals(ServiceControllerStatus.Stopped)) || (sc.Status.Equals(ServiceControllerStatus.StopPending))) { sc.Start(); //启动服务 } } public void PostTest() { SetService
阅读全文
读取XML 文件 - Read xml file
摘要:public string getReproTid() { string path = AppcompatExtend.AppcompatExtend.ProgramFiles + @"\GFI\WebMonitor\Data\Reports.xml"; // file path if (!File.Exists(path)) { path = AppcompatExtend.AppcompatExtend.ProgramFilesX86 + @"\GFI\WebMonitor\Data\Reports.xml"; } XmlDocument doc =
阅读全文
浙公网安备 33010602011771号