private void Page_Load(object sender, System.EventArgse) { //在此处放置用户代码以初始化页面 string url = System.Net.HttpWebRequesthttpReq; System.Net.HttpWebResponsehttpRes; System.UrihttpURL = new Uri(url); httpReq =(System.Net.HttpWebRequest)System.Net.WebRequest.Create(httpURL); httpReq.Method= "GET"; httpRes= (System.Net.HttpWebResponse)httpReq.GetResponse(); httpReq.KeepAlive= false; System.IO.StreamReadersReader = newSystem.IO.StreamReader(httpRes.GetResponseStream(),System.Text.Encoding.GetEncoding("GB")); stringres = sReader.ReadToEnd(); //以下是利用正则表达式对获取的文本流进行过滤 stringstrRegex = @"<a.+?a>"; System.Text.RegularExpressions.Regexr; System.Text.RegularExpressions.MatchCollectionm; r = newSystem.Text.RegularExpressions.Regex(strRegex,System.Text.RegularExpressions.RegexOptions.IgnoreCase); m =r.Matches(res); Response.Write("该页共有"+m.Count + " 个超连接<br/>"); for (inti = 0; i < m.Count; i++) { Response.Write(m[i].Value+ "<br/>"); } }
推荐整理分享用asp.net实现 取页面中的所有链接(asp.net runat),希望有所帮助,仅作参考,欢迎阅读内容。
![用asp.net实现 取页面中的所有链接(asp.net runat)](https://www.jiuchutong.com/image/20240129/1706504404.jpg)
文章相关热门搜索词:asp点net,asp.net foreach,asp.net attributes,asp.net foreach,asp.net literal,asp . net,asp.net literal,asp.net foreach,内容如对您有帮助,希望把文章链接给更多的朋友!
用bat实现定时执行任务的批处理文件 @echooffsettxt1=%date:~0,4%::当前年settxt2=%date:~5,2%::当前月settxt3=%date:~8,2%::当前日settxt4=%time:~0,2%::当前小时settxt5=%time:~3,2%::当前分钟settxt6=%time:~6,2%::当前秒setdat
用bat实现的自动关机的代码 一般情况下我们都是使用shutdown来实现关机与重启用法:shutdown[/i|/l|/s|/r|/a|/p|/h|/e][/f][/m\computer][/txxx][/d[p:]xx:yy[/c"comment"]]没有参数显示帮助。这与键入/?
批处理(dos/bat)最完整人性化教程第1/2页 这是一篇技术教程,我会用很简单的文字表达清楚自己的意思,你要你识字就能看懂,就能学到知识。写这篇教程的目的,是让每一个看过这些文字的