asp过滤字符串中的HTML代码
   
   
   
    时间:2009-03-25    点击:1657   
    
    
 
    <%
'过滤字符串Str中的HTML代码
Public Function FilterHtml(Str)
    If Trim(Str) = "" Or IsNull(Str) Then
        FilterHtml=""
    Else
    Str = Replace(Str, ">", ">")
    Str = Replace(Str, "<", "<")
    Str = Replace(Str, Chr(32), " ")
    Str = Replace(Str ,Chr(9), " ")
    Str = Replace(Str, Chr(34), """)
    Str = Replace(Str, Chr(39), "'")
    Str = Replace(Str, Chr(13), "")
    Str = Replace(Str, Chr(10) & Chr(10), "</p><p>")
    Str = Replace(Str, Chr(10), "<br> ")
    FilterHtml = Str
    End If
End Function
%>
<form name="form1" method="post" action="">
  输入字符串: 
  <input name="text" type="text" id="text" >
  <input type="submit" name="Submit" value="提交">
</form>
<%
Dim X
X=Request.Form("text")
If X<>"" Then
%>
<p>输入的字符串为:<%=X%></p>
<p>过滤HTML代码后的字符串为:<%=FilterHtml(X)%></p>
<%
End If
%>
       
  
     	
 asp创建和调整动态数组
  asp创建和调整动态数组
	     	
 asp计算中英文混合字符串的长度
  asp计算中英文混合字符串的长度
	     	
 asp判断字符串是否以指定字符串开头或结尾
  asp判断字符串是否以指定字符串开头或结尾
	     	
 asp判断字符是否是英文字符
  asp判断字符是否是英文字符
	     	
 asp检测字符串出现的次数
  asp检测字符串出现的次数
	     
    
    
    
 
             
  
   
  
  
  地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
    
  
  © Copyright 2012 上海网络 
Product  All Rights Reserved