Desert plug-in is a very good thing, in the key wizard and language inside a lot of use, you can find the background to find the word, write game automatic script used particularly much. Write an automatic script in front, check some information, easy language is not too familiar, key wizard function may not be implemented, find some information, desert plug-ins can be used in C # call. Share the next method here.
One, the reference Ddm.dll.NET inside can directly reference, reference method, add Reference--com--find DM, double-click to register Desert plugin
//This is a way to register the DLL to the system, register the Desert to call Autoregcom ("Regsvr32-s dm.dll");Static stringAutoregcom (stringstrcmd) { stringRinfo; Try{Process myprocess=NewProcess (); ProcessStartInfo Myprocessstartinfo=NewProcessStartInfo ("Cmd.exe"); Myprocessstartinfo.useshellexecute=false; Myprocessstartinfo.createnowindow=true; Myprocessstartinfo.redirectstandardoutput=true; Myprocess.startinfo=Myprocessstartinfo; Myprocessstartinfo.arguments="/ C"+Strcmd; Myprocess.start (); StreamReader Mystreamreader=Myprocess.standardoutput; Rinfo=Mystreamreader.readtoend (); Myprocess.close (); Rinfo= Strcmd +"\ r \ n"+Rinfo; returnRinfo; } Catch(Exception ex) {returnEx. Message; } }
Iii. instantiation of the Desert object
New Dm.dmsoft ();
Four, call the desert method directly through the instantiation of the object DM call, such as DM. MoveTo (30, 30); Complete code: Put a button on the form, click the button, call the desert plugin to move the mouse to (30,30)
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Diagnostics;usingSystem.IO;namespaceplayer{ Public Partial classPlayer:form { PublicPlayer () {InitializeComponent (); Autoregcom ("regsvr32-s Dm.dll"); } Private voidButton1_Click (Objectsender, EventArgs e) {Dm.dmsoft Dm=NewDm.dmsoft (); Dm. MoveTo ( -, -); } Static stringAutoregcom (stringstrcmd) { stringRinfo; Try{Process myprocess=NewProcess (); ProcessStartInfo Myprocessstartinfo=NewProcessStartInfo ("Cmd.exe"); Myprocessstartinfo.useshellexecute=false; Myprocessstartinfo.createnowindow=true; Myprocessstartinfo.redirectstandardoutput=true; Myprocess.startinfo=Myprocessstartinfo; Myprocessstartinfo.arguments="/ C"+Strcmd; Myprocess.start (); StreamReader Mystreamreader=Myprocess.standardoutput; Rinfo=Mystreamreader.readtoend (); Myprocess.close (); Rinfo= Strcmd +"\ r \ n"+Rinfo; returnRinfo; } Catch(Exception ex) {returnEx. Message; } } }}
C # Call Desert plugin