0

私は C# Windows フォーム アプリを使用しており、コンテンツ Web サイトをダウンロードし、編集後に外部ブラウザーに表示したいと考えています。

WebClient client = new WebClient();
string s = client.DownloadString("http://google.com");

外部ブラウザで文字列 html を表示するにはどうすればよいですか? 由来。

4

1 に答える 1

0
WebClient client = new WebClient();
string s = client.DownloadString("http://google.com");
Process.Start("http://www.google.com");

もう少し複雑にしたい場合は、ローカルファイルに保存し、 Process.Start() 関数を使用して外部ブラウザで開くことができます。

WebClient client = new WebClient();
string s = client.DownloadString("http://google.com");
StreamWriter sw = File.CreateText("google.html");
sw.Write(s);
sw.Close();
Process.Start("google.html");
于 2016-01-11T23:03:58.063 に答える