开发者

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

开发者 https://www.devze.com 2023-03-24 02:16 出处:网络
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?

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

精彩评论

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