public static string GetSourceTextByUrl(string url)
{
WebRequest request = WebRequest.Create(url);
request.Timeout = 200000;//20秒超时
WebResponse response = request.GetResponse();
Stream resStream = response.GetResponseStream();
StreamReader sr = new StreamReader(resStream);
string tempstr = sr.ReadToEnd();
Regex r1 = new Regex("
", RegexOptions.IgnoreCase);
Regex r2 = new Regex("
", RegexOptions.IgnoreCase);
Regex r3 = new Regex("
", RegexOptions.IgnoreCase);
//过滤
");
tempstr = r1.Replace(tempstr, "");
tempstr = r2.Replace(tempstr, "");
tempstr = r3.Replace(tempstr, "");
tempstr = r4.Replace(tempstr, "");
tempstr = r5.Replace(tempstr, "");
return tempstr;
}
通过错新技术频道小编介绍的asp.net 生成静态时的过滤viewstate的实现方法,相信大家都有了一定的了解,想要了解更多的技术内容,请继续关注错新技术频道吧!