0

我使用 C# windows form 应用程序,我想下载内容网站,并在编辑后显示在外部浏览器中。

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

如何在外部浏览器中显示 String html (s)?看待。

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 回答