1. 程式人生 > >網頁中遮蔽右鍵方法

網頁中遮蔽右鍵方法

〈HTML〉〈HEAD〉〈TITLE〉網頁加密解密〈/TITLE〉
〈META http-equiv=Content-Type content="text/html; charset=gb2312"〉
〈META content="MSHTML 6.00.2600.0" name=GENERATOR〉〈!-- 大地軟體工作室--〉〈LINK
href="/style.css" rel=stylesheet〉
〈META content="Microsoft FrontPage 4.0" name=GENERATOR〉
〈/HEAD〉
〈BODY bgColor=#ffffff leftMargin=0 topMargin=0 onload=initStyleElements()〉
〈DIV
style="LEFT: 139px; WIDTH: 106px; POSITION: absolute; TOP: 52px; HEIGHT: 36px"〉

〈TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0〉〈!--DWLayoutTable--〉
〈TBODY〉
〈TR〉
〈TD vAlign=top align=center width=760 height=310〉
〈DIV align=center〉
〈H2〉
〈SCRIPT language=JavaScript〉
〈!--
var i=0;
var ie=(document.all)?1:0;
var ns=(document.layers)?1:0;

function initStyleElements() /* Styles for Buttons Init */
{
var c = document.pad;
if (ie)
{
//c.text.style.backgroundColor="#DDDDDD";
c.compileIt.style.backgroundColor="#C0C0A8";
c.compileIt.style.cursor="hand";
c.select.style.backgroundColor="#C0C0A8";
c.select.style.cursor="hand";
c.view.style.backgroundColor="#C0C0A8";
c.view.style.cursor="hand";
c.retur.style.backgroundColor="#C0C0A8";
c.retur.style.cursor="hand";
c.clear.style.backgroundColor="#C0C0A8";
c.clear.style.cursor="hand";
}
else return;
}

/* Buttons Enlightment of "Compilation" panel */
function LightOn(what)
{
if (ie) what.style.backgroundColor = '#E0E0D0';
else return;
}
function FocusOn(what)
{
if (ie) what.style.backgroundColor = '#EBEBEB';
else return;
}
function LightOut(what)
{
if (ie) what.style.backgroundColor = '#C0C0A8';
else return;
}
function FocusOff(what)
{
if (ie) what.style.backgroundColor = '#DDDDDD';
else return;
}
/* Buttons Enlightment of "Compilation" panel */

function generate() /* Generation of "Compilation" */
{
code = document.pad.text.value;
if (code)
{
document.pad.text.value='Compiling...Please wait!';
setTimeout("compile()",1000);
}
else alert('First enter something to compile and then press CompileIt')
}
function compile() /* The "Compilation" */
{
document.pad.text.value='';
compilation=escape(code);
document.pad.text.value="/〈script〉\n〈!--\ndocument.write(unescape(\""+compilation+"\"));\n//--〉\n〈\/script〉";
i++;
if (i=1) alert("Page compiled 1 time!");
else alert("Page compiled "+i+" times!");
}
function selectCode() /* Selecting "Compilation" for Copying */
{
if(document.pad.text.value.length〉0)
{
document.pad.text.focus();
document.pad.text.select();
}
else alert('Nothing for be selected!')
}
function preview() /* Preview for the "Compilation" */
{
if(document.pad.text.value.length〉0)
{
pr=window.open("","Preview","scrollbars=1,menubar=1,status=1,width=700,
height=320,left=50,top=110");
pr.document.write(document.pad.text.value);
}
else alert('Nothing for be previewed!')
}
function uncompile() /* Decompiling a "Compilation" */
{
if (document.pad.text.value.length〉0)
{
source=unescape(document.pad.text.value);
document.pad.text.value=""+source+"";
}
else alert('You need compiled code to uncompile it!')
}
// --〉
〈/SCRIPT〉
〈BR〉〈B〉〈FONT color=#333333〉網頁HTML原始碼加密解密器〈/FONT〉〈/B〉〈/H2〉〈/DIV〉
〈TABLE cellSpacing=0 borderColorDark=#000000 cellPadding=10 width=750
align=center borderColorLight=#ffffff border=2〉
〈TBODY〉
〈TR〉
〈TD〉
〈DIV align=center〉〈BR〉將你的原始碼貼到編輯區域即可〈BR〉〈BR〉
〈TABLE cellSpacing=0 cellPadding=0 width="100%" border=0〉
〈TBODY〉
〈TR〉
〈TD width="100%"〉〈!-- Compilation Panel --〉
〈FORM name=pad method=post align="center"〉
〈DIV align=center〉〈TEXTAREA style="WIDTH: 95%; BACKGROUND-COLOR: #ebebeb" name=text rows=11 cols=58〉〈/TEXTAREA〉
〈BR〉〈BR〉〈BR〉〈INPUT onmouseover=LightOn(this) onclick=generate() onmouseout=LightOut(this) type=button value=加密 name=compileIt〉
〈INPUT onmouseover=LightOn(this) onclick=selectCode() onmouseout=LightOut(this) type=button value=全選 name=select〉
〈INPUT onmouseover=LightOn(this) onclick=preview() onmouseout=LightOut(this) type=button value=預覽 name=view〉
〈INPUT onmouseover=LightOn(this) onclick=uncompile() onmouseout=LightOut(this) type=button value=解密 name=retur〉
〈INPUT onmouseover=LightOn(this) onmouseout=LightOut(this) type=reset value=清除 name=clear〉
〈/DIV〉〈/FORM〉〈!-- Compilation Panel --〉〈/TD〉〈/TR〉〈/TBODY〉〈/TABLE〉〈/DIV〉〈/TD〉〈/TR〉〈/TBODY〉〈/TABLE〉
〈DIV align=center〉〈BR〉〈/DIV〉
〈DIV align=center〉〈/DIV〉 〈/TD〉〈/TR〉〈/TBODY〉〈/TABLE〉
〈/DIV〉
〈DIV〉〈/DIV〉〈/BODY〉〈/HTML〉