查看Html源码的代码
1
WebClient wc = new WebClient();
2
wc.Credentials = CredentialCache.DefaultCredentials;
3
4
///方法一:
5
Byte[] pageData = wc.DownloadData(Request.Url.ToString());
6
txtExpress.Text = Encoding.Default.GetString(pageData);
7
txtExpress.Text = Regex.Replace(txtExpress.Text,"<(.|\n)+?>", "");//<[^>]*>
8
//替换空格
9
txtExpress.Text = Regex.Replace(txtExpress.Text,"\\s+", " ");
10
wc.Dispose();
WebClient wc = new WebClient();2
wc.Credentials = CredentialCache.DefaultCredentials;3

4
///方法一:5
Byte[] pageData = wc.DownloadData(Request.Url.ToString());6
txtExpress.Text = Encoding.Default.GetString(pageData);7
txtExpress.Text = Regex.Replace(txtExpress.Text,"<(.|\n)+?>", "");//<[^>]*>8
//替换空格9
txtExpress.Text = Regex.Replace(txtExpress.Text,"\\s+", " ");10
wc.Dispose();
浙公网安备 33010602011771号