//执行更新 private static void Execute() { if (!File.Exists(string.Format("{0}\\update.bat", PathCore.WorkingPath))) { string line1 = "Taskkill /F /IM handler.exe"; string line2 = "ping -n 3 127.0.0.1>nul"; string line3 = "del /s /Q " + @"""" + Environment.CurrentDirectory + "\\handler.exe" + @""""; string line4 = "ping -n 3 127.0.0.1>nul"; string line5 = @"ren """ + Environment.CurrentDirectory + @"\\handler-new.exe"" ""handler.exe"""; string line6 = "ping -n 3 127.0.0.1>nul"; string line7 = "start " + @""""" " + @"""" + Environment.CurrentDirectory + "\\handler.exe" + @""""; string[] lines = { "@echo off", line1, line2, line3, line4, line5, line6, line7 }; File.WriteAllLines(@"./update.bat", lines, Encoding.GetEncoding("GBK")); } ProgressCore.StartProcess(string.Format("{0}\\update.bat", PathCore.WorkingPath)); }
//九天验证码输入检测 public static bool IsIdentifyCode() { if (MonitorCore.GetTaskCore().IsAutoVote&& ConfigCore.IsAdsl) { return(false); } IntPtr hwnd = HwndUtil.FindWindow("WTWindow", null); IntPtr hwndSysTabControl32 = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "SysTabControl32", ""); IntPtr testHwnd = HwndUtil.FindWindowEx(hwndSysTabControl32, IntPtr.Zero, "Button", "输入验证码后回车,看不清直接回车切换"); if (testHwnd != IntPtr.Zero) { if (MonitorCore.GetTaskCore().IsAutoVote) { AutoVote.AddVoteProjectNameDroped(false); } ProgressCore.KillProcess(false); return(true); } return(false); }