private void Form2_Load(object sender, EventArgs e)
{
AsynRun(openUrl);
}
private void openUrl()
{
this.Invoke(new bbbb(aaaa));
}
private delegate void bbbb();
private void aaaa()
{
webBrowser1.Navigate("http://www.baidu.com");
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
Application.DoEvents();
webBrowser1.document.getElementByIdx_x("kw").Focus();
SendKeys.SendWait("^v");
}
private void AsynRun(ThreadStart ts)
{
Thread thread = new Thread(ts);
thread.IsBackground = true;
thread.Start();
}
{
AsynRun(openUrl);
}
private void openUrl()
{
this.Invoke(new bbbb(aaaa));
}
private delegate void bbbb();
private void aaaa()
{
webBrowser1.Navigate("http://www.baidu.com");
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
Application.DoEvents();
webBrowser1.document.getElementByIdx_x("kw").Focus();
SendKeys.SendWait("^v");
}
private void AsynRun(ThreadStart ts)
{
Thread thread = new Thread(ts);
thread.IsBackground = true;
thread.Start();
}