這表明System.Byte[]
因爲它是展現data
,不data
的內容的說明。要做到這一點做這樣的事情:
WebClient client = new WebClient();
byte[] file = client.DownloadData("example.com");
File.WriteAllBytes(@"example.txt", file);
string[] lines = File.ReadAllLines("example.txt");
richTextBox1.Text = lines;
要看到的實際內容
編輯
或者你也可以做WebClient.DownloadString
像@Ria建議。只有我會實現它是這樣的:
WebClient client = new WebClient();
var data = client.DownloadString("example.com");
richTextBox1.Text = data.ToString();
或者更有效的甚至
richTextBox1.Text = client.DownloadString("example.com");
在谷歌簡單搜索就會發現: http://stackoverflow.com/questions/7118860/download -html-page-in-c-sharp – liran63 2012-07-29 00:55:22