void Button1Click(object sender, EventArgs e) { DmSoft dm = new DmSoft(); dm.Delay(2000); dm.KeyPressStr(".ddaccJJdAA23JKDJSK23dlaJdjlj666"); }
void init() { this.SourceFile = System.IO.Directory.GetCurrentDirectory() + "\\Source\\"; dm = new MyDmSoft(); dm.SetPath(this.SourceFile); this.waiting = new Waiting(); this.waiting.Endless = false; this.dm.BindWindowEx(this.Simulator.Hwnd, "dx.graphic.opengl", "windows", "windows", "", 0); Thread.Sleep(200); this.dm.Capture(this.Simulator.Name + ".bmp"); Controller.ViewPrintLine("已截图!"); Controller.ViewPrintLine("句柄:{0}", this.Simulator.Hwnd); }
internal static int KeyPressStr(string keyStr, int iszs = 0, int delay = 6) { try { var dm = new DmSoft(); var isCapsLock = (((ushort)GetKeyState(0x14)) & 0xffff) != 0; if (isCapsLock) { dm.KeyPress(20); } foreach (var chr in keyStr) { if (char.IsUpper(chr)) { dm.KeyPress(20); dm.Delay(6); dm.KeyPressChar(chr.ToString()); dm.Delay(6); dm.KeyPress(20); } else { dm.KeyPressChar(chr.ToString()); } dm.Delay(iszs == 0 ? delay : new Random().Next(1 + delay, 100 + delay)); } if (isCapsLock) { dm.KeyPress(20); } } catch { return(0); } return(1); }
internal static int WriteIniPwd(string section, string key, string v, string file, string pwd) { var dm = new DmSoft(); return(dm.WriteIni(AesEncrypt(AesEncrypt(section, pwd), "TYYXPWD"), AesEncrypt(AesEncrypt(key, pwd), "TYYXPWD").Replace("=", string.Empty), AesEncrypt(AesEncrypt(v, pwd), "TYYXPWD"), file)); }
internal static string ReadIniPwd(string section, string key, string file, string pwd) { var dm = new DmSoft(); return(AesDecrypt(AesDecrypt(dm.ReadIni(AesEncrypt(AesEncrypt(section, pwd), "TYYXPWD"), AesEncrypt(AesEncrypt(key, pwd), "TYYXPWD").Replace("=", string.Empty), file), "TYYXPWD"), pwd)); }