Exemple #1
0
 public static void click(IntPtr hwnd, int int_0, int int_1)
 {
     MockInput.SetForegroundWindow(hwnd);
     MockInput.SetCursorPos(int_0, int_1);
     MockInput.mouse_event(32770, int_0, int_1, 0, IntPtr.Zero);
     MockInput.mouse_event(32772, int_0, int_1, 0, IntPtr.Zero);
 }
Exemple #2
0
        public static void press_key(char char_0)
        {
            byte num = MockInput.getkeycode(char_0);

            MockInput.keybd_event(num, 0, 0, 0);
            MockInput.keybd_event(num, 0, MockInput.KEYEVENTF_KEYUP, 0);
        }
Exemple #3
0
 public static void Multi_Ctrl_Any(byte byte_0)
 {
     MockInput.keybd_event(17, 0, 0, 0);
     MockInput.keybd_event(byte_0, 0, 0, 0);
     MockInput.keybd_event(17, 0, MockInput.KEYEVENTF_KEYUP, 0);
     MockInput.keybd_event(byte_0, 0, MockInput.KEYEVENTF_KEYUP, 0);
 }
Exemple #4
0
 public void sendKey(IntPtr hwnd, string string_0)
 {
     for (int i = 0; i < string_0.Length; i++)
     {
         Thread.Sleep(10);
         MockInput.SetForegroundWindow(hwnd);
         SendKeys.SendWait(string_0.Substring(i, 1));
     }
 }
Exemple #5
0
 public static void input(string string_0, int sleepSec)
 {
     for (int i = 0; i < string_0.Length; i++)
     {
         if (sleepSec != 0)
         {
             Thread.Sleep(sleepSec);
         }
         MockInput.press_key(string_0.Substring(i, 1).ToCharArray()[0]);
     }
 }
Exemple #6
0
		public static void mouseMove(int int_0, int int_1, int int_2)
		{
			MockInput.SetCursorPos(int_0, int_1);
			int int2 = (int_2 - int_0) / 9;
			MockInput.mouse_event(32770, int_0, int_1, 0, IntPtr.Zero);
			for (int i = 0; i < int2 + 1; i++)
			{
				MockInput.SetCursorPos(int_0 + i * 9, int_1);
				Thread.Sleep(20);
			}
			MockInput.mouse_event(32772, int_2, int_1, 0, IntPtr.Zero);
		}
Exemple #7
0
 public void sendKeyPwd(IntPtr hwnd, string string_0, int int_0, int int_1)
 {
     for (int i = 0; i < string_0.Length; i++)
     {
         Thread.Sleep(200);
         MockInput.SetForegroundWindow(hwnd);
         MockInput.SetCursorPos(int_0, int_1);
         MockInput.mouse_event(32770, int_0, int_1, 0, IntPtr.Zero);
         MockInput.mouse_event(32772, int_0, int_1, 0, IntPtr.Zero);
         SendKeys.SendWait(string_0.Substring(i, 1));
     }
 }
Exemple #8
0
        private void method_5(object object_0)
        {
            int num = int.Parse(object_0.ToString());

            try
            {
                MockInput.mouseMove(this.int_1, this.int_2, this.int_1 + num);
            }
            catch (Exception exception)
            {
                this.method_9(string.Concat("[drag]出错了!", exception.ToString()));
            }
        }
Exemple #9
0
 public static void inputAndClick(string string_0, int sleepSec, IntPtr hwnd, int int_0, int int_1)
 {
     for (int i = 0; i < string_0.Length; i++)
     {
         if (sleepSec != 0)
         {
             Thread.Sleep(sleepSec);
         }
         MockInput.SetForegroundWindow(hwnd);
         MockInput.SetCursorPos(int_0, int_1);
         MockInput.mouse_event(32770, int_0, int_1, 0, IntPtr.Zero);
         MockInput.mouse_event(32772, int_0, int_1, 0, IntPtr.Zero);
         MockInput.press_key(char.Parse(string_0.Substring(i, 1)));
     }
 }
Exemple #10
0
        public static void mouseMove(int int_0, int int_1, int int_2)
        {
            int jishu = new Random().Next(7, 15);

            MockInput.SetCursorPos(int_0, int_1);
            int int2 = (int_2 - int_0) / jishu;

            MockInput.mouse_event(32770, int_0, int_1, 0, IntPtr.Zero);
            for (int i = 0; i < int2 + 1; i++)
            {
                MockInput.SetCursorPos(int_0 + i * jishu, int_1 + new Random().Next(1, 5));
                Thread.Sleep(new Random().Next(1, 100));
            }
            MockInput.mouse_event(32772, int_2, int_1, 0, IntPtr.Zero);
        }
Exemple #11
0
 public static void Key_ESC()
 {
     MockInput.keybd_event(27, 0, 0, 0);
     MockInput.keybd_event(27, 0, MockInput.KEYEVENTF_KEYUP, 0);
 }
Exemple #12
0
 public static void click(int int_0, int int_1)
 {
     MockInput.SetCursorPos(int_0, int_1);
     MockInput.mouse_event(32770, int_0, int_1, 0, IntPtr.Zero);
     MockInput.mouse_event(32772, int_0, int_1, 0, IntPtr.Zero);
 }
Exemple #13
0
 public static void MultiKey_Ctrl_V()
 {
     MockInput.Multi_Ctrl_Any(86);
 }
Exemple #14
0
 public static void MultiKey_Ctrl_Enter()
 {
     MockInput.Multi_Ctrl_Any(13);
 }
Exemple #15
0
 public static void MultiKey_Ctrl_C()
 {
     MockInput.Multi_Ctrl_Any(67);
 }
Exemple #16
0
 public static void Key_BackSpace()
 {
     MockInput.keybd_event(8, 0, 0, 0);
     MockInput.keybd_event(8, 0, MockInput.KEYEVENTF_KEYUP, 0);
 }
Exemple #17
0
 private void timer_0_Tick_1(object sender, EventArgs e)
 {
     try
     {
         this.timer_0.Stop();
         HtmlElement elementById = this.webBrowserLoginAlimama.Document.GetElementById("TPL_username_1");
         if (!(!(elementById != null) || this.username.Equals("") ? true : this.password.Equals("")))
         {
             base.Visible     = true;
             base.WindowState = FormWindowState.Normal;
             base.Activate();
             IntPtr intPtr = TaobaoLoginForm.FindWindow(null, this.Text);
             TaobaoLoginForm.SetForegroundWindow(intPtr);
             HtmlElement htmlElement = this.webBrowserLoginAlimama.Document.GetElementById("TPL_username_1");
             Point       offset      = this.GetOffset(htmlElement);
             Point       point       = this.method_4(this.webBrowserLoginAlimama);
             this.int_1 = point.X + offset.X + 100;
             this.int_2 = point.Y + offset.Y + 35;
             MockInput.click(intPtr, this.int_1, this.int_2);
             elementById.InvokeMember("click");
             elementById.SetAttribute("value", this.username);
             Thread.Sleep(400);
             SendKeys.Send("{TAB}");
             this.timer_0 = new System.Windows.Forms.Timer()
             {
                 Interval = 1500
             };
             this.timer_0.Tick += new EventHandler(this.timer_0_Tick_2);
             this.timer_0.Start();
         }
         else if (this.loginErrCnt < 5)
         {
             TaobaoLoginForm taobaoLoginForm = this;
             taobaoLoginForm.loginErrCnt = taobaoLoginForm.loginErrCnt + 1;
             this.timer_0 = new System.Windows.Forms.Timer()
             {
                 Interval = 1000
             };
             this.timer_0.Tick += new EventHandler(this.timer_0_Tick_1);
             this.timer_0.Start();
         }
         else
         {
             this.cleanCookie();
             this.method_9("等待【登录页面打开】超过5次!");
             this.loginErrCnt = 0;
             this.webBrowserLoginAlimama.Navigate(this.string_2);
             this.timer_0 = new System.Windows.Forms.Timer()
             {
                 Interval = 3000
             };
             this.timer_0.Tick += new EventHandler(this.timer_0_Tick_1);
             this.timer_0.Start();
         }
     }
     catch (Exception exception2)
     {
         Exception exception = exception2;
         try
         {
             this.cleanCookie();
             this.method_9(string.Concat("[inputAlimamaUserName]出错,等待3秒重试!", exception.ToString()));
             this.webBrowserLoginAlimama.Navigate(this.string_2);
             this.timer_0 = new System.Windows.Forms.Timer()
             {
                 Interval = 3000
             };
             this.timer_0.Tick += new EventHandler(this.timer_0_Tick_1);
             this.timer_0.Start();
         }
         catch (Exception exception1)
         {
             this.method_9(string.Concat("[inputAlimamaUserName]出错!ex1:", exception1.ToString()));
         }
     }
 }
Exemple #18
0
 public static void Key_Enter()
 {
     MockInput.keybd_event(13, 0, 0, 0);
     MockInput.keybd_event(13, 0, MockInput.KEYEVENTF_KEYUP, 0);
 }