1

を使用して別のブラウザを開いています

ProcessStartInfo startBrowser = new ProcessStartInfo(internetbrowser, website);
Process.Start(startBrowser);

これはうまくいきます。ただし、Web ページがいつ読み込まれたかを知る必要もあります。これを確認する方法はありますか?それとも、ページが完全に読み込まれたときにイベントを発生させますか?

ありがとう

4

1 に答える 1

0

質問の中で、どのブラウザを使用したいかわかりませんでした。

を使用する場合Internet Explorerは、良い解決策があります。SHDocVw.dll以下の例については、への参照が必要です。

テスト済みのコード例:

private void Form1_Load(object sender, EventArgs e)
{
            InternetExplorer explorer = new InternetExplorer();

            object Empty = 0;
            object URL = "http://www.yourwebsite.com"; // Here your URL

            // There are many more events.. But we need this one:
            explorer.DocumentComplete += ExplorerOnDocumentComplete; 

            explorer.Visible = true; // If you wish to see the IE, set it to true.

            // Navigate to the provided URL
            explorer.Navigate2(ref URL, ref Empty, ref Empty, ref Empty, ref Empty);

}

private void ExplorerOnDocumentComplete(object pDisp, ref object url)
{
            // The document loaded completly. 
            // Do your work here.
}
于 2012-12-04T22:39:49.683 に答える