复制代码 代码如下:
WebClient wc = new WebClient();
Byte[] pageData = wc.DownloadData("http://xxxx.com");
hd_num.Value = Encoding.Default.GetString(pageData);
前台代码:<asp:HiddenField runat="server" />
再通过js获取hd_num的值。
复制代码 代码如下:
HttpWebRequest request = HttpWebRequest.Create("http://xxx/aaa.ashx") as HttpWebRequest;
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
Stream resStream = response.GetResponseStream();
StreamReader sr = new StreamReader(resStream, System.Text.Encoding.Default); //编码可以改成别的
ContentHtml.Text = sr.ReadToEnd();
新闻热点
疑难解答
图片精选