MyApp.exeの0x0e90a1c0で処理されない例外:0xC0000005:アクセス違反。WebBrowserコントロールを別のスレッドで実行すると、ランタイムエラーが発生するのはなぜですか?
投稿に基づいてHow might I create and use a WebBrowser control on a worker thread?私は別のスレッドでWebPagePump
クラスを実行しようとしています。
for (int i = 0; i < 5; i++)
{
Thread t = new Thread(delegate() { WebNav1(); });
t.Start();
}
private Action WebNav1 = delegate()
{
WebPagePump a = new WebPagePump();
a.Navigate(new Uri("http://www.mywebsite.com"));
a.Completed += delegate(WebBrowser wb)
{
Console.WriteLine("It's loaded!");
a.Dispose();
};
};
は見慣れ。 WebPagePumpのポイントはあなた自身のスレッドを開始する必要はありませんでした。あなたがまだ問題を抱えているなら、 'new Thread'を取り除き、スタックトレースを投稿してください。 –