asp.net中过略html代码
// <summary>
/// 过滤html代码
/// </summary>
public static string RphtmlStr(string html)
{
try
{
System.Text.RegularExpressions.Regex regex1 = new System.Text.RegularExpressions.Regex(@"<script[\s\S]+</script *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regex regex2 = new System.Text.RegularExpressions.Regex(@" href *= *[\s\S]*script *:", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regex regex3 = new System.Text.RegularExpressions.Regex(@" no[\s\S]*=", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regex regex4 = new System.Text.RegularExpressions.Regex(@"<iframe[\s\S]+</iframe *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regex regex5 = new System.Text.RegularExpressions.Regex(@"<frameset[\s\S]+</frameset *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Regex regex6 = new System.Text.RegularExpressions.Regex(@"\<img[^\>]+\>", System.Text.RegularExpres
相关文档:
1、文本标签(命令)
<pre></pre> 创建预格式化文本
<h1></h1> 创建最大的标题
<h6></h6> 创建最小的标题
<b&g ......
在转向新的页面时,会出现下面的错误
无法找到资源。
说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。
请求的 URL: /lonin.aspx
解决方法如下:
1.首先,要重新注册IIS :运行cmd 后 进入“C:\WINDOWS\Microsoft.NET\Fra ......
一、Response对象
Response对象是HttpResponse类的一个实例。该类主要是封装来自ASP.NET操作的HTTP响应信息。
1.Response对象的属性
① BufferOutput
说明:获取或设置一个值,该值指示是否缓冲输出,并在完成处理整个页之后将其发送
属性值:如果缓冲了到客户端的输出, ......
//得到数据为库连接
SqlConnection con=new SqlConnection("数据库连接字符串");
//用存储过程名称和数据库连接创建SqlCommand 对象
SqlCommand command = new SqlCommand("存储过程名称",con);
//打开连接
con.Open();
//对数据库进行相应的操作
...................................
........................... ......
一、认识Web.config文件
Web.config 文件是一个XML文本文件,它用来储存 ASP.NET Web 应用程序的配置信息(如最常用的设置ASP.NET Web 应用程序的身份验证方式),它可以出现在应用程序的每一个目录中。当你通过.NET新建一个Web应用程序后,默认情况下会在根目录自动创建一个默认的Web.config文件,包括默认 ......