- ·上一篇文章:asp获取当前网页地址的代码
- ·下一篇文章:asp加密解密函数decrypt
asp下经常用到的代码
点击提示“确定”与“取消”提示框
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") 
%>
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下经常用到的代码