当前位置:首页 > ASP教程 > 应用技巧

asp下经常用到的代码

点击提示“确定”与“取消”提示框
onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}'


删除.ldb文件
<%
application.contents.removeall()
%>

将html格式转换为纯文本格式
<%  
function removehtml(strhtml)  
 dim objregexp, match, matches     
 set objregexp = new regexp  

 objregexp.ignorecase = true  
 objregexp.global = true  
 '取闭合的<>  
 objregexp.pattern = "<.+?>"  
 '进行匹配  
 set matches = objregexp.execute(strhtml)  

 ' 遍历匹配集合,并替换掉匹配的项目  
 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") 
%>
【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!