C# webbrowser模擬鼠標(biāo)輸入和鍵盤輸入的方法,網(wǎng)上好多方法都不行,這個(gè)終于可以了
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
鼠標(biāo)模擬點(diǎn)擊的: 鍵盤模擬輸入的: { SendKeys.Send(b[i].ToString()); SendKeys.Flush(); delayTime(rd.Next(500, 2000)); } 這里送一個(gè)delaytime函數(shù),可以在webbrowser執(zhí)行輸入等操作之后等一段時(shí)間,等它自己做自己的事情不會(huì)卡死 private void delayTime(double msecond) { DateTime tempTime = DateTime.Now; while (tempTime.AddMilliseconds(msecond).CompareTo(DateTime.Now) > 0) Application.DoEvents();} 該文章在 2018/1/13 11:33:30 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |