在网页中怎么获取这个数值啊,源代码里面没有
1个回答
展开全部
public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.DataGrid dgData; private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 dgData.DataSource=getInfo(); dgData.DataBind(); } //根据Url地址得到网页的html源码 private string GetWebContent1(string Url) { string strResult=""; try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url); //声明一个HttpWebRequest请求 request.Timeout = 30000; //设置连接超时时间 request.Headers.Set("Pragma", "no-cache"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream streamReceive = response.GetResponseStream(); System.Text.Encoding encoding = System.Text.Encoding.GetEncoding("GB2312"); StreamReader streamReader = new StreamReader(streamReceive, encoding); strResult = streamReader.ReadToEnd(); } catch { return ""; } return strResult; } //获取超级链接和文章标题、
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询