C # API Beginners to develop coordinates to achieve 11 battle platform automatic Login

Source: Internet
Author: User

usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Runtime.InteropServices;usingSystem.Windows.Forms;namespaceapitest{ Public Partial classForm1:form { PublicForm1 () {InitializeComponent (); } [DllImport ("user32.dll", EntryPoint ="Setcursorpos")]        Private Static extern intSetcursorpos (intXinty); [DllImport ("user32.dll", EntryPoint ="mouse_event")]         Public Static extern voidMouse_event (intDwFlags,intDX,intDy,intCbuttons,intdwExtraInfo); Const intMouseeventf_move =0x0001;//Mobile Mouse (10): 1        Const intMouseeventf_leftdown =0x0002;//simulate the left mouse button press (10): 2        Const intMouseeventf_leftup =0x0004;//simulate the left mouse button lifted (10): 4        Const intMouseeventf_rightdown =0x0008;//mimic the right mouse button press (10): 8        Const intMouseeventf_rightup =0x0010;//mimic the right mouse button lift (10):        Const intMouseeventf_middledown =0x0020;//imitate the middle mouse button press (10):        Const intMouseeventf_middleup =0x0040;//mimic middle mouse button lift (10):        Const intMouseeventf_absolute =0x8000;//indicate if absolute coordinates are taken (10): 32768        Private voidForm1_Load (Objectsender, EventArgs e) {            intIX =710; intIY =510; Sendkeys.sendwait ("HongHu123");            Setcursorpos (IX, IY); Mouse_event (Mouseeventf_leftdown,0,0,0,0); Mouse_event (Mouseeventf_leftup,0,0,0,0); System.Threading.Thread.Sleep ( -);//Set the pause time, otherwise the account and password will be sent in a boxsendkeys.sendwait ("{Tab}");//Send tabSendkeys.sendwait ("PWD123456");//Enter the game passwordSendkeys.sendwait ("{ENTER}");//Input Enter key        }    }}
View Code

C # API Beginners to develop coordinates to achieve 11 battle platform automatic Login

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.