テキスト ファイルにいくつかの Web URL を挿入しました。
お気に入り:
www.google.com
www.facebook.com
www.twitter.com
www.yahoo.com
そして、C# webBrowse1 コントロールで Web ページの URL 形式のテキスト ファイルを参照したいと考えています。
それがどのように機能するか教えてください。
これは私のコードですが、うまくいきませんでした。
try
{
FileStream fs = new FileStream("link.txt",FileMode.Open,FileAccess.Read);
StreamReader sr = new StreamReader(fs);
webBrowser1.Navigate(sr);
webBrowser1.ScriptErrorsSuppressed = true;
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
}
catch(Exception)
{
MessageBox.Show("Internet Connection not found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
}