提供一种“间接防止另存为”的方法

提供一种“间接防止另存为”的方法
特点:笨笨的、烦烦的
因为需要用到3个垃圾文件(不过还好,加起来才10来行不太熟悉的代码)
条件:无(客户能保证自己正常浏览就行了)
文件:
主页面 main.htm
垃圾文件:x.asp,xx.asp

main.htm
///////////////////

 1<html>
 2<head>
 3<title></title>
 4<script language="javascript" src="x.asp"></script>
 5</head>
 6<body>   
 7这里放入一个iframe   
 8src="xx.asp"   
 9</body>
10</html>

////////////////
x.asp
//////////

1   
2Response.ContentType = "application/x-javascript"   
3Response.Expires = 0   
4Response.Expiresabsolute = Now() - 1   
5Response.AddHeader "pragma","no-cache"   
6Response.AddHeader "cache-control","private"   
7Response.CacheControl = "no-cache"   
8session("show")=true   

//////////////////
xx.asp
////////////////

1   
2if session("show")=true then   
3session("show")=false   
4Response.Redirect "要显示的页面"   
5else   
6  
7Response.Write "欢迎光临"   
8end if   
9  

///////////////////////////
不当之处见笑了。

Published At
Categories with Web编程
Tagged with
comments powered by Disqus