你可以考虑通过API调用,向指定的坐标发送消息,模拟鼠标点击那个位置,这个方法的前提是,网页中flash左边点的位置,是相对可计算的。用PostMessage API! [DllImport("user32.dll", EntryPoint="PostMessage")] public static extern int PostMessage ( int hwnd, int wMsg, int wParam, int lParam );hwnd ----------- Long,接收消息的那个窗口的句柄。如设为HWND_BROADCAST,表示投递给系统中的所有顶级窗口。如设为零,表示投递一条线程消息(参考PostThreadMessage) wMsg ----------- Long,消息标识符 wParam --------- Long,具体由消息决定 lParam --------- Any,具体由消息决定
private void Form15_Load(object sender, EventArgs e)
{
this.webBrowser1.Navigate("http://www.baidu.com");
}
private void button1_Click(object sender, EventArgs e)
{
this.webBrowser1.Document.GetElementById("wd").InnerText = this.textBox1.Text.Trim();
this.webBrowser1.Document.GetElementById("su").InvokeMember("click");
//this.webBrowser1.Document.InvokeScript("text",new String[] { "called from client code" });//调用脚本
}
我要flash连接。就是通过网站进入一个全flash界面,用程序实现点击操作。
[DllImport("user32.dll", EntryPoint="PostMessage")]
public static extern int PostMessage (
int hwnd,
int wMsg,
int wParam,
int lParam
);hwnd ----------- Long,接收消息的那个窗口的句柄。如设为HWND_BROADCAST,表示投递给系统中的所有顶级窗口。如设为零,表示投递一条线程消息(参考PostThreadMessage) wMsg ----------- Long,消息标识符 wParam --------- Long,具体由消息决定 lParam --------- Any,具体由消息决定