C#-Wait for IE to load?

2019-06-02 21:11发布

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

2条回答
我命由我不由天
2楼-- · 2019-06-02 21:27

This might be what you're looking for

p.WaitForInputIdle()
查看更多
祖国的老花朵
3楼-- · 2019-06-02 21:42

Just do this:

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

It'll open it in the default browser.

查看更多
登录 后发表回答