读取一条网址内的内容 在textbox里输入http://forum.csdn.net/BList/DotNET/,然后就显示该页面的HTML代码出来。并且查询到<span id="test">fdafds</span>标签内的内容fdafds. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 HttpWebRequest webRequest2 = (HttpWebRequest)WebRequest.Create(new Uri(url)); webRequest2.CookieContainer = webcookies["1"]; HttpWebResponse rsps = (HttpWebResponse)webRequest2.GetResponse(); StreamReader sr = new StreamReader(rsps.GetResponseStream(), Encoding.UTF8); html = sr.ReadToEnd(); sr.Close(); string patten="id=\"test\">(?<value>)</span>"; Regex r = new Regex(patten, RegexOptions.IgnoreCase); MatchCollection collections = r.Matches(html); string patten="id=\"test\">(?<value>)</span>"; Regex r = new Regex(patten, RegexOptions.IgnoreCase); MatchCollection collections = r.Matches(html);这个如何输入得到标签里的value? HTML代码已经可以获取到,但是string字符的长度不够。该怎么办。 求高手指点 [求教各位]图片上传到网站问题 C#两个m*n的int数组如何进行加法运算 vs2005中动态引用eWebEditor 写代码的一些困惑,寻求帮助 统计计算机上的可用的盘个文件夹问题 picturebox如何加载多张图片? 新手求助-关于下拉框的默认值 关于Listener的问题:(请TheAres等大哥进来) 面向对象与自定义数据表 winform 中更新数据时用timer控件,怎么让他不删屏?在线等待,急! 使用httpwebrequest模拟登录后的cookie
webRequest2.CookieContainer = webcookies["1"];
HttpWebResponse rsps = (HttpWebResponse)webRequest2.GetResponse();
StreamReader sr = new StreamReader(rsps.GetResponseStream(), Encoding.UTF8);
html = sr.ReadToEnd();
sr.Close();
string patten="id=\"test\">(?<value>)</span>";
Regex r = new Regex(patten, RegexOptions.IgnoreCase);
MatchCollection collections = r.Matches(html);
Regex r = new Regex(patten, RegexOptions.IgnoreCase);
MatchCollection collections = r.Matches(html);
这个如何输入得到标签里的value?