HTML是:
《a》 id="linkCreateOrder" class="btn_o140 btn_left"
onclick="SubmitCreateOrder();return false;"
href="javascript:void(3)">buy《a/》
代码是:
void eb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
webBrowser1.Document.Click += new HtmlElementEventHandler(Document_Click);
}
}
void Document_Click(object sender, HtmlElementEventArgs e)
{
//e.BubbleEvent = true;
HtmlDocument htmlDocument = webBrowser1.Document;
HtmlElement htmlElement = htmlDocument.GetElementFromPoint(e.ClientMousePosition);
if (htmlElement.Id == "linkCreateOrder")
{
htmlElement.Style="background:#FF0000";
}
}
我努力了:
htmlelment.invokemember("click"),invokemember("onclick")
// and
htmldocument.invokescript("SubmitCreateOrder()");
// and
object obj = htmlElement.DomElement;
System.Reflection.MethodInfo mi = obj.GetType().GetMethod("click");
mi.Invoke(obj, new object[0]);
这些都不是我需要的。