开发者

Need to click a button inside a frame of IE through Webbrowser toolbox

I have opened a site by giving ID and password through webbrwoser1.navigate method. Then on the opened page there is a 3frames. I need to click a button inside a frame say "a". How can i do that?

These all are happ开发者_开发百科ening inside the webbrowser control box.


First option

HtmlElement el = extWebbrowser.Document.Window.Frames["YourFrame"].Document.All["YourElement"];
object obj = el.DomElement;
System.Reflection.MethodInfo mi = obj.GetType().GetMethod("click");
mi.Invoke(obj, new object[0]);

Second Option

extWebBrowser.Document.Window.Frames["YourFrame"].Document.All["YourElement"].InvokeMember("click");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜