C#-Wait for IE to load?

人盡茶涼 提交于 2020-01-03 03:20:07

问题


I'm opening a URL in a web browser using the following code:

        Process p = new Process();
        p.StartInfo.FileName = GetDefaultBrowserPath();  //gets path to default browser from the registry
        p.StartInfo.Arguments = "htp://www.google.com";
        p.Start();

Can someone tell me how I would wait for IE to be loaded? Is this the correct way to go about this?

Thanks, Jimmy


回答1:


Just do this:

Process.Start("http://www.google.com");

It'll open it in the default browser.




回答2:


This might be what you're looking for

p.WaitForInputIdle()


来源:https://stackoverflow.com/questions/4270062/c-wait-for-ie-to-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!