防止复制和粘贴 [英] preventing copy and paste

查看:112
本文介绍了防止复制和粘贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在asp.net中使用window.open()函数打开一个页面.....

在打开的页面v可以复制(ctrl a)和粘贴(ctrl v)...

我怎么能阻止该页面的复制/粘贴

Hi,

I am opening a page in asp.net using window.open() function .....
in opened page v can copy(ctrl a) and paste (ctrl v)...
how could i prevent the copy/paste of that page

推荐答案

你不能。一旦您将页面呈现给他们的浏览器,用户就可以用它做他们想做的事情。无论你做什么试图阻止他们,总会有办法解决它。



我怀疑这不是你想要的答案,但其他任何事情都是谎言。



Peter
You can't. Once you have presented the page to their browser, the user can do what they want with it. No matter what you do to try and stop them, there's always a way around it.

I suspect this is not the answer you wanted, but anything else is a lie.

Peter


看看:

你可以用 `user-select` CSS3属性



像这样的HTML:

Have a look:
You can use `user-select` CSS3 propertie

HTML like this :
<span class="protected">Datas you wants protect</span>





和对应的CSS:



And the correspondant CSS :

.protected {
        -moz-user-select:none;
        -webkit-user-select:none;
        user-select:none;
    }





查看示例: http:// jsfiddle。 net / DoubleYo / RPv4q / [ ^ ]



此解决方案不是跨浏览器,但使用firefox和chrome / safari工作正常



高级用户可以复制您的内容查看页面来源,制作pdf或打印页面,有些人提到了萤火虫,小提琴手。

参考:禁止从webpag复制数据e [ ^ ]



..以及更多供参考:

使用jQuery在ASP.NET TextBox中预防剪切,复制和粘贴操作 [ ^ ]

在asp.net中使用javascript禁用文本框中的复制粘贴剪切选项 [ ^ ]

在Asp.Net TextBox中使用JavaScript禁用复制粘贴右键单击 [ ^ ]



..等等 google [ ^ ]



See an example : http://jsfiddle.net/DoubleYo/RPv4q/[^]

This solution is not cross browser but work fine with firefox and chrome/safari

Advanced user can copy your content with view the page source, make pdf or print your page, and some people mention firebug, fiddler.
Ref.: Disable copying data from webpage[^]

..and more for reference:
Prevent Cut, Copy and Paste Operations in an ASP.NET TextBox using jQuery[^]
Disable Copy Paste cut options in textbox using javascript in asp.net[^]
Disable Copy Paste Right Click Using JavaScript In Asp.Net TextBox[^]

..and more threads on google[^]


这篇关于防止复制和粘贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆