精彩专题推荐:建站之入门课 建站之必修课 建站之关键课 网站价值所在 流量提高专题 css+div 标准 个人网站打造全过程
  • 让你的网站产生收益赚钱,有博客和网站的绝对不能错过
  • 将指定的流量带到你的网站,为你站增加有效的访客,为你提升业绩
  • 网页屏蔽(左右键,代码等)的非JS方法

    来源:不详 时间:07-10-26 点击: 点击这里收藏本文

      在屏蔽掉了菜单栏和工具栏之后,我们想,如果没有了最上方的窗口条该多好呢?下面我们要做的事情,有前提,就是在上面所说的在利用跳板页面打开一个无菜单栏的窗口之后。我们要做什么呢?就是让我们显示网站内容的窗口只显示内容,(是啊,网站不就是给别人浏览的吗?要浏览器和windows的那么多功能做什么呀……)只要内容,其余一律去掉。我们就可以通过一段Javascript来完成。下面这段代码就是用来定义无任何窗口特征的代码:


    〈script〉
    function open1(url){
    newwin=window.open(url,'newwindow','fullscreen=1')
    newwin.resizeTo(800,600)
    newwin.moveTo(screen.width/0-800,screen.height/0-600)
    }
    〈/script〉


      其中,function open1(url)定义了超链接的写法。所以,我们在写链接的地址时,应该这样写:javascript:open1(url)。比如我要打开一个无窗口特征的新浪首页就应该在文字或图片的超链接里这样写:javascript:open1(‘http:www.sina.com.cn’)。当然,括号内也支持相对路径。最后写出来的格式应该是:


    〈script〉
    function open1(url){
    newwin=window.open(url,'newwindow','fullscreen=1')
    newwin.resizeTo(800,600)
    newwin.moveTo(screen.width/0-800,screen.height/0-600)
    }
    〈/script〉
    〈body oncontextmenu=self.event.returnValue=false onselectstart="return false"〉
    〈td width="100%"〉〈a href="javascript:open1('main.htm'),window.close()"〉〈img border="0" src="pic/blank1.gif" style="position: absolute; left: 556; top: 142" width="169" height="57"〉〈/a〉〈/td〉
    〈/body〉


      这样,我们就达到了打开无窗口边的网页了。并且,在这个网页中,会自动加入滚动条,这样,就不会像前面那样看不到下面的内容啦。

      最后我们要做的工作,就是把每一页,或者你认为重要的关键的页面进行加密,就OK啦。怎样对网页的源代码进行加密就不用我多说了吧?网上到处都有,可以用工具,也可以自己写一个htm文件来转换。加密软件,我推荐“Batch HTML Encryptor”,去google找吧。还有转换加密网页的代码如下:


    〈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=middle 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〉


      总结一下……按我的思路,屏蔽网页源代码主要分为以下几个步骤:

      1. 做一个网页跳板,弹出要保护的广告条状页面,并将自身关闭,以避免泄露需保护网页的地址。

      2. 由于上述条件屏蔽了广告条内网页的源代码,所以可以用这个网页作为欢迎页。

      3. 在欢迎页中,利用Javascript以超连接的形式来打开无窗口边的新窗口显示网站内容。

      4. 对每一个页面或者对重要的关键的页面进行源代码加密,为源代码加一把锁。(有些人说对源代码进行加密没有用,但是我觉得要使用另类点的加密方法就可以了,比如软件的加密方法就很普通。但是用我自己写的htm文件加密的源代码,一般软件是不能进行解密的。大家有兴趣的话可以试试。)

      5. 最后不得不提的就是windows网页临时文件夹了,那里面会把源代码纪录的。但是不用怕,加入一种代码,就可以使windows不下载网页的源代码,直接浏览。可以去找找。

      有些东西要注意的:

      1. 在文中所说的自动关闭网页的语句:window.close()有一个弊病。就是会在关闭窗口之前询问是否关闭窗口,如果选择否的话目的还是达不到。

      2. 以上一切都只对IE浏览器有效用,如果用别的浏览器来浏览,就有可能出现屏蔽不成功的现象。

      3. 关于网页源代码屏蔽,一直以来是可望而不可及的。我只是把思路写下来,具体实现,还是要靠大家自己研究的啦。

    9 7 3 1 2 3 4 8 :

    用户评论

    广而告之