//MM启动 public static void Start() { TaskCore taskCore = MonitorCore.GetTaskCore(); taskCore.ProjectName = TaskCore.TASK_VOTE_MM; IntPtr hwnd = IntPtr.Zero; do { if (!taskCore.NameCheck()) { return; } hwnd = HwndUtil.FindWindow("WTWindow", null); Thread.Sleep(500); } while (hwnd == IntPtr.Zero); //设置拨号延迟 IntPtr ButtonHwnd = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "Button", "设置"); IntPtr hwndEx = HwndUtil.FindWindowEx(ButtonHwnd, IntPtr.Zero, "Edit", "2"); if (hwndEx == IntPtr.Zero) { hwndEx = HwndUtil.FindWindowEx(ButtonHwnd, IntPtr.Zero, "Edit", "3"); } if (hwndEx == IntPtr.Zero) { hwndEx = HwndUtil.FindWindowEx(ButtonHwnd, IntPtr.Zero, "Edit", "4"); } HwndUtil.setText(hwndEx, (ConfigCore.Delay / 1000).ToString()); //设置工号 if (ConfigCore.InputId.Equals("1")) { ButtonHwnd = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "Button", "会员"); hwndEx = HwndUtil.FindWindowEx(ButtonHwnd, IntPtr.Zero, "Edit", null); hwndEx = HwndUtil.FindWindowEx(ButtonHwnd, hwndEx, "Edit", null); hwndEx = HwndUtil.FindWindowEx(ButtonHwnd, hwndEx, "Edit", null); hwndEx = HwndUtil.FindWindowEx(ButtonHwnd, hwndEx, "Edit", null); hwndEx = HwndUtil.FindWindowEx(ButtonHwnd, hwndEx, "Edit", null); HwndUtil.setText(hwndEx, ConfigCore.Id); } //开始投票 hwndEx = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, null, "自动投票"); HwndThread.createHwndThread(hwndEx); taskCore.FinishStart(); }
public static void StopAndUpload() { IntPtr hwnd = HwndUtil.FindWindow("WTWindow", null); if (hwnd != IntPtr.Zero) { IntPtr hwndEx = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "Button", "停止"); while (!Net.IsOnline()) { Thread.Sleep(500); } HwndThread.createHwndThread(hwndEx); Thread.Sleep(5000); } }
public static void StopAndUpload() { IntPtr hwnd = HwndUtil.FindWindow("ThunderRT6FormDC", null); if (hwnd != IntPtr.Zero) { IntPtr hwndEx = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, null, "停止投票"); while (!Net.IsOnline()) { Thread.Sleep(500); } HwndThread.createHwndThread(hwndEx); Thread.Sleep(5000); } }
public static void StopAndUpload() { IntPtr hwnd = HwndUtil.FindWindow("TMainForm", null); if (hwnd != IntPtr.Zero) { IntPtr hwndTGroupBox = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "TGroupBox", "当前状态"); IntPtr hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, IntPtr.Zero, "TButton", "停 止"); while (!Net.IsOnline()) { Thread.Sleep(500); } HwndThread.createHwndThread(hwndEx); Thread.Sleep(5000); } }
//JZ启动 public static void start() { TaskCore taskCore = MonitorCore.GetTaskCore(); taskCore.ProjectName = TaskCore.TASK_VOTE_JZ; IntPtr hwnd = IntPtr.Zero; do { if (!taskCore.NameCheck()) { return; } hwnd = HwndUtil.FindWindow("TMainForm", null); Thread.Sleep(500); } while (hwnd == IntPtr.Zero); //设置拨号延迟 IntPtr hwndEx = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwnd, hwndEx, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwnd, hwndEx, "TEdit", null); HwndUtil.setText(hwndEx, (ConfigCore.Delay / 1000).ToString()); //设置工号 if (ConfigCore.InputId.Equals("1")) { IntPtr hwndTGroupBox0 = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "TGroupBox", "会员选项"); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox0, IntPtr.Zero, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox0, hwndEx, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox0, hwndEx, "TEdit", null); HwndUtil.setText(hwndEx, ConfigCore.Id); } //开始投票 IntPtr hwndTGroupBox = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "TGroupBox", "当前状态"); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, IntPtr.Zero, "TButton", "开 始"); HwndThread.createHwndThread(hwndEx); taskCore.FinishStart(); }
public static void StopAndUpload() { IntPtr hwnd = HwndUtil.FindWindow("WTWindow", null); if (hwnd != IntPtr.Zero) { IntPtr hwndEx = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, null, "停止投票"); while (!Net.IsOnline()) { Thread.Sleep(500); } HwndThread.createHwndThread(hwndEx); int s = 0; IntPtr hwndTip; do { s++; hwndTip = HwndUtil.FindWindow(null, "投票软件提示"); Thread.Sleep(500); } while (hwndTip == IntPtr.Zero && s < 60); } }
//JT启动 public static void start() { TaskCore taskCore = MonitorCore.GetTaskCore(); taskCore.ProjectName = TaskCore.TASK_VOTE_JT; IntPtr hwnd = IntPtr.Zero; do { if (!taskCore.NameCheck()) { return; } hwnd = HwndUtil.FindWindow("ThunderRT6FormDC", null); Thread.Sleep(500); } while (hwnd == IntPtr.Zero); //设置拨号延迟 IntPtr ThunderRT6Frame = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "ThunderRT6Frame", "设置"); IntPtr hwndEx = HwndUtil.FindWindowEx(ThunderRT6Frame, IntPtr.Zero, "ThunderRT6TextBox", null); hwndEx = HwndUtil.FindWindowEx(ThunderRT6Frame, hwndEx, "ThunderRT6TextBox", null); HwndUtil.setText(hwndEx, (ConfigCore.Delay / 1000).ToString()); //设置工号 if (ConfigCore.InputId.Equals("1")) { ThunderRT6Frame = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "ThunderRT6Frame", "会员"); hwndEx = HwndUtil.FindWindowEx(ThunderRT6Frame, IntPtr.Zero, "ThunderRT6TextBox", null); HwndUtil.setText(hwndEx, ConfigCore.Id); } //开始投票 hwndEx = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, null, "自动投票"); HwndThread.createHwndThread(hwndEx); taskCore.FinishStart(); }
//圆球启动 public static void Start() { TaskCore taskCore = MonitorCore.GetTaskCore(); taskCore.ProjectName = TaskCore.TASK_VOTE_YUANQIU; IntPtr hwnd = IntPtr.Zero; do { if (!taskCore.NameCheck()) { return; } hwnd = HwndUtil.FindWindow("TForm1", null); Thread.Sleep(1000); } while (hwnd == IntPtr.Zero); Thread.Sleep(1000); //设置拨号延迟 IntPtr hwndTGroupBox = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "TGroupBox", "设置"); IntPtr hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, IntPtr.Zero, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, hwndEx, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, hwndEx, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, hwndEx, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, hwndEx, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, hwndEx, "TEdit", null); hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, hwndEx, "TEdit", null); HwndUtil.setText(hwndEx, (ConfigCore.Delay / 1000).ToString()); //设置工号 //if (ConfigCore.InputId.Equals("1")) //{ // hwndTGroupBox = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "TGroupBox", "会员"); // hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, IntPtr.Zero, "TEdit", null); // HwndUtil.setText(hwndEx, ConfigCore.Id); // hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, hwndEx, "TEdit", null); // HwndUtil.setText(hwndEx, ConfigCore.Id); // hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, hwndEx, "TEdit", null); // HwndUtil.setText(hwndEx, ConfigCore.Id); // hwndEx = HwndUtil.FindWindowEx(hwndTGroupBox, hwndEx, "TEdit", null); // HwndUtil.setText(hwndEx, ConfigCore.Id); //} //开始投票 int count = 0; do { hwndEx = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "TButton", "开始"); Thread.Sleep(1000); if (count > 0) { LogCore.Write($"等待圆球启动{count}秒"); } count++; } while (hwndEx == IntPtr.Zero && count < 10); HwndThread.createHwndThread(hwndEx); taskCore.FinishStart(); }