当前位置:K88软件开发文章中心编程语言AspAsp01 → 文章内容

asp下经常用到的代码

减小字体 增大字体 作者:     来源:asp编程网  发布时间:2018-12-30 8:31:15

点击提示“确定”与“取消”提示框
onclick=&apos

{if(confirm("您确定删除吗?此操作将不能恢复!"))
{return 
true
}return 
false
}&apos



删除.LDB文件
<
%
Application.Contents.Removeall()
%>


将HTML格式转换为纯文本格式
<

 

Function 
RemoveHTML(strHTML) 
 

 
Dim 
objRegExp, 
Match, 
Matches 
 
 
 
 

 
Set 
objRegExp 

New 
Regexp 
 


 
objRegExp.IgnoreCase 

True 
 

 
objRegExp.Global 

True 
 

 
&apos
取闭合的<> 
 

 
objRegExp.Pattern 

"<.+?>" 
 

 
&apos
进行匹配 
 

 
Set 
Matches 

objRegExp.Execute(strHTML) 
 


 
&apos
 
遍历匹配集合,并替换掉匹配的项目 
 

 
For 
Each 
Match 
in 
Matches 
 
 
 
 

 
 
 
 
 
strHtml=Replace(strHTML,Match.Value,"") 
 

 
Next 
 

 
RemoveHTML=strHTML 
 

 
Set 
objRegExp 

Nothing 
 

End 
Function 
 


%>

调用
<
%=RemoveHTML(你的字段)%>



25、当前页地址
<


response.write 
"http://"&Request.ServerVariables("server_name")&Request.ServerVariables("script_name") 

%>

asp下经常用到的代码