更新时间:2023-02-11 20:39:11
您可以禁用右键单击,但这是一个坏主意,因为专家的头脑可以从您的页面中读取任何内容。
您不能完全隐藏页面源 - 这是不可能的。在互联网上没有足够的安全。
You can disable the right click, but that's a bad idea because expert minds can read anything from your page. You cannot totally hide the page source - this is not possible. Nothing is secure enough on the Internet.
无论如何,您可以加密并设置密码。
您可以使用此链接 - 它将使用密码加密您的HTML页面。
In any case, you can encrypt it and set a password. You can utilise this link - it will encrypt your HTML page with a password.
首先,禁用右键单击,直接写入该脚本。
First up, disable the right click, by writing out this script, right after the tag.
<SCRIPT language=JavaScript>
<!-- http://www.spacegun.co.uk -->
var message = "function disabled";
function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; }
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } }
document.onmousedown = rtclickcheck;
</SCRIPT>
然后,加密所有这一切,在本网站称为AES加密。
Then, encrypt all of it, in this website, called 'AES encryption'.
链接 - http://aesencryption.net/
您需要设置密码才能解密...您选择密码。
You need to set a password to decrypt it ....you choose the password.
加密后,您只需写一个基本的HTML页面,再次放入< head>
标签中,将脚本禁用右键单击,进入< body>
标签,您编码并隐藏所有内容,只需在页面顶部写入< html hidden>
。
After encrypting it, you can just write a basic HTML page just putting into the <head>
tag once again the script to disable the right click, into the <body>
tag you code and hide everything just writing at top of the page <html hidden>
.
示例
<!DOCTYPE html>
<html hidden>
<head>
<SCRIPT language=JavaScript>
<!-- http://www.spacegun.co.uk -->
var message = "function disabled";
function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; }
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } }
document.onmousedown = rtclickcheck;
</SCRIPT>
</head>
<body>
--here, you put the encrypted code from the link above--
</body>
</html>
写在哪里 var message =function disabled;
你可以写出例如这个页面不能被看到的东西,或者会让大多数用户感到烦恼,并且只会离开。 [此页面不可用等等....
Where it is written var message = "function disabled";
you can write for example something like 'This page cannot be viewed' or something which will annoy most of the users and will just leave. ['This page is unavailable' and so on ....].
最后,一旦您右键点击,您将看到一个空白页面,并显示一条消息这一页。该消息将像此页面不再有效。
Finally, you will see a blank page with a message coming up as soon as you right click the page. The message will be something like 'This page is no longer active'.
示例
<SCRIPT language=JavaScript>
<!-- http://www.spacegun.co.uk -->
var message = "**This page is no longer active**";
function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; }
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } }
document.onmousedown = rtclickcheck;
</SCRIPT>
我知道可以删除< html hidden>
或 Javascript脚本与一些附加组件,如Firebug,但无论如何,您将需要使用密码解密代码,以便看到真正的页面。
我认为专家用户可能会用暴力攻击来查看源代码。
所以没有什么是安全的。
I do know that one can remove the <html hidden>
or the Javascript script with some add-ons such as Firebug but anyway you will need to decrypt the code with a password in order to see the real page.
Expert users might view the source code with a Brute Force attack, I think.
So, nothing is safe.
我发现一个应用程序需要安装在你的电脑上。
企业版中有一项功能,但您必须支付才能获得。此功能是一种加密您的HTML页面的工具,可以使用最多384位密钥为HTML文件创建超强密码加密[我上面写的链接使用多达256位密钥进行加密)。
我从来没有尝试过,因为它不是免费的。
I found out an application that you need to instal on your computer. There is a feature in the Enterprise version but you must pay to get it. This feature is a tool which encrypt your HTML page creating an ultra-strong password encryption for HTML files using up to 384 bit keys for encryption [the link I wrote above uses up to 256 bit keys for encryption]. I have never tried it out, though, because it is not for free.
无论如何,软件HTML Guardian的链接 - http://www.protware.com/default.htm
有关加密的功能,只需点击页面中的超强HTML密码保护。
Anyway, the link of the software 'HTML Guardian' - http://www.protware.com/default.htm For the feature about the encryption, merely click on 'Ultra-Strong HTML password protection' in the page.