禁用从网页复制数据 [英] Disable copying data from webpage

查看:101
本文介绍了禁用从网页复制数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找任何方法来创建网页,使用户不会能够从我的网页复制内容。即用户将无法选择网页上的任何文字present。
假设我在asp.net工作

I was looking for any way to create web page,so that user wont be able to copy content from my web page. i.e. User wont be able to select the any text present on the webpage. Let's assume i am working on asp.net

任何有趣的想法来完成任务?

Any interesting ideas to accomplish the task ?

推荐答案

您可以使用用户选 CSS3 propertie

You can use user-select CSS3 propertie

HTML这样的:

<span class="protected">Datas you wants protect</span>

和的CSS通讯员:

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

请参阅我的例子: http://jsfiddle.net/DoubleYo/RPv4q/

这解决方案是不是跨浏览器,但做工精细与Firefox和Chrome / Safari浏览器

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

编辑:高级用户可以将您的内容与视图复制的页面源代码,使PDF格式或打印网页,有的人提萤火虫,提琴手

EDIT : advanced user can copy your content with view the page source, make pdf or print your page, and some people mention firebug, fiddler.

这篇关于禁用从网页复制数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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