找回密码
 注册

怎样在网页种禁止复制粘贴文字,最好还有禁止查看源文件,禁止另存为的功能

[复制链接]
Persephone 发表于 26-2-2008 09:58:18 | 显示全部楼层 |阅读模式

马上注册成为YANBONG会员吧!
时下最热门的资讯、娱乐、贴图等分享都在这里等你发掘哦!

您需要 登录 才可以下载或查看,没有账号?注册

×
1.利用弹出窗口封锁鼠标右键   
   <script    language="javascript">function    click()    {if   (event.button==2)   {alert(本站不准使用右键,使用左键吧!^_^)}}document.onmousedown=click</script>   
    2.彻底封锁鼠标右键   
    <script>   
    function     dm(e){if(!ns){if(event.button>1)window.external.addfavorite   
   (http://www.popunet.com/,    大众网络报)}else{if(e.which>1)return   false}}ns=navigator.appname=="netscape";if(ns)document.captureevents   
    (event.mousemove|event.mousedown);document.onmousemove=dm;document.   
    onmousedown=dm;</script>   
    3.禁止查看源文件   
   
    <script     language="javascript">   
    <!--document.onmousedown=click     function     click()     {   
    if     (     event.button==2)     {alert(不准查看源文件)     }   
    if     (     event.button==3)     {alert(不准查看源文件)     }}   
    //--></script>   
   
    4.
发表者:zjh13226
代码:     [复制到剪贴板]         
    1.                      将彻底屏蔽鼠标右键   
            <table     border     oncontextmenu=return(false)><td>no</table>         可用于table   
   
    2.       <body     >                                     取消选取、防止复制   
   
   3.                                                                                       不准粘贴   
   
    4.                                                   防止复制   
   
    5.       <link     rel="shortcut     icon"     href="favicon.ico">     ie地址栏前换成自己的图标   
   
    6.       <link     rel="bookmark"     href="favicon.ico">       可以在收藏夹中显示出你的图标   
   
    7.       <input     style="ime-mode:disabled">                                                         关闭输入法   
   
    8.       永远都会带着框架   
    <script     language="javascript"><!--   
        if     (window     ==     top)top.location.href     =     "frames.htm";     //frames.htm为框架网页   
    //     --></script>   
   
    9.       防止被人frame   
    <script     language=javascript><!--     
        if     (top.location     !=     self.location)top.location=self.location;   
    //     --></script>   
   
    10.     <noscript><iframe     src=*.html></iframe></noscript>             网页将不能被另存为   
   
   
    11.     <input     type=button     value=查看网页源代码     
    >   
   
    12.     怎样通过asp的手段来检查来访者是否用了代理   
    <%     if     request.servervariables("http_x_forwarded_for")<>""     then   
    response.write     "<font     color=#ff0000>您通过了代理服务器,"&     _   
    "真实的ip为"&request.servervariables("http_x_forwarded_for")   
    end     if   
    %>   
   
    13.     取得控件的绝对位置   
   
    //javascript   
    <script     language="javascript">   
    function     getie(e){   
        var     t=e.offset;   
        var     l=e.offsetleft;   
        while(e=e.offsetparent){   
            t+=e.offset;   
            l+=e.offsetleft;   
            }   
        alert("top="+t+"\nleft="+l);   
        }   
    </script>   
   
    //vbscript   
    <script     language="vbscript"><!--   
    function     getie()   
        dim     t,l,a,b   
        set     a=document.all.img1   
        t=document.all.img1.offset   
        l=document.all.img1.offsetleft   
        while     a.tagname<>"body"   
            set     a     =     a.offsetparent   
            t=t+a.offset   
            l=l+a.offsetleft   
        wend   
        msgbox     "top="&t&chr(13)&"left="&l,64,"得到控件的位置"   
    end     function   
    --></script>   
   
    14.     光标是停在文本框文字的最后   
    <script     language="javascript">   
    function     cc()   
    {   
        var     e     =     event.srcelement;   
        var     r     =e.createtextrange();   
        r.movestart(character,e.value.length);   
        r.collapse(true);   
        r.select();   
    }   
    </script>   
    <input     type=text     name=text1     value="123"     >   
   
    15.     判断上一页的来源   
    asp:   
    request.servervariables("http_referer")   
   
    javascript:   
    document.referrer   
   
    16.     最小化、最大化、关闭窗口   
    <object     id=hh1     classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">     
    <param     name="command"     value="minimize"></object>   
    <object     id=hh2     classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">     
    <param     name="command"     value="maximize"></object>   
    <object     id=hh3     classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">   
    <param     name="command"     value="close"></object>   
   
    <input     type=button     value=最小化     onclick=hh1.click()>   
    <input     type=button     value=最大化     onclick=hh2.click()>   
    <input     type=button     value=关闭     onclick=hh3.click()>   
    本例适用于ie   
   
    17.     
    <%   
    定义数据库连接的一些常量   
    const     adopenforwardonly             =     0     游标只向前浏览记录,不支持分页、recordset、bookmark   
   const    adopenkeyset                      =    1   键集游标,其他用户对记录说做的修改将反映到记录集中,但其他用户增加或删除记录不会反映到记录集中。支持分页、recordset、bookmark   
    const     adopendynamic                     =     2     动态游标功能最强,但耗资源也最多。用户对记录说做的修改,增加或删除记录都将反映到记录集中。支持全功能浏览(access不支持)。   
    const     adopenstatic                       =     3     静态游标,只是数据的一个快照,用户对记录说做的修改,增加或删除记录都不会反映到记录集中。支持向前或向后移动   
   
    const     adlockreadonly                   =     1     锁定类型,默认的,只读,不能作任何修改   
    const     adlockpessimistic             =     2     当编辑时立即锁定记录,最安全的方式   
    const     adlockoptimistic               =     3     只有在调用update方法时才锁定记录集,而在此前的其他*作仍可对当前记录进行更改、插入和删除等   
    const     adlockbatchoptimistic     =     4     当编辑时记录不会被锁定,而更改、插入和删除是在批处理方式下完成的   
   
    const     adcmdtext       =     &h0001   
    const     adcmdtable     =     &h0002   
    %>   
   
    18.     网页不会被缓存   
    htm网页   
    <meta     http-equiv="pragma"     c>   
    <meta     http-equiv="cache-control"     c>   
    <meta     http-equiv="expires"     c>   
    或者<meta     http-equiv="expires"     c>   
    asp网页   
        response.expires     =     -1   
        response.expiresabsolute     =     now()     -     1   
        response.cachecontrol     =     "no-cache"   
    php网页   
    header("expires:     mon,     26     jul     1997     05:00:00     gmt");   
    header("cache-control:     no-cache,     must-revalidate");   
    header("pragma:     no-cache");   
   
   
    19.     检查一段字符串是否全由数字组成   
    <script     language="javascript"><!--   
    function     checknum(str){return     str.match(/\d/)==null}   
    alert(checknum("1232142141"))   
    alert(checknum("123214214a1"))   
    //     --></script>   
   
    20.     获得一个窗口的大小   
    document.body.clientwidth,document.body.clientheight   
   
    21.     怎么判断是否是字符   
    if     (/[^\x00-\xff]/g.test(s))     alert("含有汉字");   
    else     alert("全是字符");   
   
    22.textarea自适应文字行数的多少   
    <textarea     rows=1     name=s1     cols=27     >     
   
    to     tal(tal)     :   
    防止工具下载的代码:   
   
    useragent=trim(lcase(request.servervariables("http_user_agent")))   
   if    instr(useragent,"teleport")>0    or   instr(useragent,"webzip")>0    or   instr(useragent,"flashget")>0    or   instr(useragent,"offline")>0    then   
    response.write     "非法浏览操作,请不要使用teleport、webzip这类软件下载本站,也不要使用googlebot这类浏览器浏览本站。"   
    response.end   
    end     if
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

ADVERTISEMENT

Archiver|手机版|小黑屋|YANBONG

GMT+8, 29-3-2024 23:14

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

重要声明:本网站是以即时上载留言的方式运作,本站对所有留言的真实性、完整性及立场等,不负任何法律责任。而一切留言之言论只代表留言者个人意见,并非本网站之立场,用户不应信赖内容,并应自行判断内容之真实性。由于讨论区是受到「即时留言」运作方式所规限,故不能完全监察所有即时留言,若读者发现有留言出现问题,请联络我们。本站有权删除任何留言及拒绝任何人士留言,同时亦有不删除留言的权利。切勿撰写粗言秽语、诽谤、渲染色情暴力或人身攻击的言论,敬请自律。
Proudly hosted by
LinodeDigital Ocean
快速回复 返回顶部 返回列表