2006/07/06 | 如何让浏览者无法"查看"或"复制"网页的source code?
类别(技术文章) | 评论(7) | 阅读(105) | 发表于 16:15
1.右键控制(但此方法不能彻底解决复制问题)
<body oncontextmenu="window.event.returnValue=false;alert("'您无法使用右键表单进行复制!'");">
2.无法选取任何物件
<body onselectstart="return false" onselect="document.selection.empty()" onondragstart="return false">
3.无法存储网页
<html>
<head>
<script language="vbscript">
dim WshShell
Set WshShell=CreateObject("WScript.Shell")

Function WriteREG()
WshShell.RegWrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoViewSource","1","REG_DWORD"
End Function
</script>
</head>
<body onLoad="WriteREG()">
</body>
</html>

以上方法只针对IE浏览器.以上方法结合使用,可解决问题
0

评论Comments

日志分类
首页[30]
转载文章[21]
技术文章[6]
美工[3]
全部都是我![0]