| 首页 | 下载中心 | 图片中心 | 
您现在的位置: 海华网 >> 编程日志 >> ASP编程 >> 文章正文 用户登录 新用户注册
网页源代码加密器         
网页源代码加密器
作者:佚名  文章来源:本站原创  点击数:  更新时间:2005-11-29
    要完成此效果把如下代码加入到<body>区域中


<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('请先把需待加密的代码copy到此框中')
    }
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("代码已编译1次!");
        else alert("代码已编译"+i+"次!");
    }
function selectCode() /* Selecting "Compilation" for Copying */
    {
        if(document.pad.text.value.length>0)
            {
                document.pad.text.focus();
                document.pad.text.select();
            }
        else alert('无任何内容被选中!')
    }
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('无任何内容可供预览!')
    }
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('请把需待还原的代码copy到此框中!')
    }
// -->
</script>

      <table border=0 cellpadding=0 cellspacing=0 width="100%">
        <tbody>
        <tr>
          <td width="100%">
            <form method=post name=pad align="center">
        <div align="center">
          <textarea cols=58 name=textarea rows=11 style="BACKGROUND-COLOR: #ebebeb; WIDTH: 95%">
文章录入:Haihua    责任编辑:Haihua 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    专 题 栏 目
    最 新 热 门
    最 新 推 荐
    相 关 文 章
    没有相关文章
        网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)