且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何防止在我的页面上下载图像。

更新时间:2023-12-01 23:16:40

你无法阻止它。你可能会采取措施使其变得更加困难,但是总是可以通过各种方式获得图片。我建议你版权

图片。如果这对你不起作用,请处理来自

javascript的oncontextmenu事件,当点击鼠标右键时会触发该事件。那里

不会是一个菜单所以图片不会被保存....大部分。


a精明的用户可以随时捕获整个屏幕并使用油漆获得

所需的碎片。


-

问候,

Alvin Bruney [ASP.NET MVP]

得到花絮?在此处获取...
http://tinyurl.com/3he3b

" moondaddy" <莫******* @ nospam.com>在消息中写道

news:%2 ****************** @ TK2MSFTNGP12.phx.gbl ...
you cannot prevent it. you may take steps to make it more difficult but
there are always ways to get the picture. i''d suggest you copyright the
picture. if this doesn''t work for you, handle the oncontextmenu event from
javascript which fires off when the right mouse button is clicked. there
won''t be a menu so the picture won''t be saved....for the most part.

a savvy user can always capture the entire screen and use paint to obtain
just the required pieces.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"moondaddy" <mo*******@nospam.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
我有一些图像需要阻止用户右键单击并选择将图片另存为?我怎么能这样做?

-
mo ******* @ nospam.com
I have images that I need to prevent the user from doing a right click and
selecting "Save Picture As"? How can I do this?

--
mo*******@nospam.com



或者您可以关闭JavaScript,上下文菜单将始终是

显示。或者您可以查看文档源,获取图像URL并直接将浏览器导航到它们。重点是不难绕过

程序化限制。


最后,可能会遇到更多麻烦然后限制

下载图片。你可能会做的是在图像上放置一些

水印,这使得这个人更难以以非合法的方式使用




" Alvin Bruney [MVP]" <蒸汽邮局的蒸汽>在消息中写道

新闻:O2 ************** @ TK2MSFTNGP10.phx.gbl ...
Or you can just turn off JavaScript and the context menu will always be
shown. Or you can view the document source, get the image URLs and navigate
the browser to them directly. Point being that it is not hard to get around
the programmatic restrictions.

In the end, it may be more trouble then it is worth to restrict the
downloading of the images. What you might do is place some kind of
watermark on the images to make it more difficult for the person to use on a
non-legitimate way.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
你无法阻止它。你可能会采取措施使其变得更加困难,但是总有办法让你了解情况。我建议你对
图片进行版权保护。如果这对你不起作用,请处理来自
javascript的oncontextmenu事件,当点击鼠标右键时会触发该事件。那里没有菜单所以图片不会被保存....大部分都是。

一个精明的用户可以随时捕获整个屏幕并使用油漆获得


-
问候,
Alvin Bruney [ASP.NET MVP]
得到花絮?在此处获取...
http://tinyurl.com/3he3b
moondaddy &LT;莫******* @ nospam.com&GT;在消息中写道
新闻:%2 ****************** @ TK2MSFTNGP12.phx.gbl ...
you cannot prevent it. you may take steps to make it more difficult but
there are always ways to get the picture. i''d suggest you copyright the
picture. if this doesn''t work for you, handle the oncontextmenu event from
javascript which fires off when the right mouse button is clicked. there
won''t be a menu so the picture won''t be saved....for the most part.

a savvy user can always capture the entire screen and use paint to obtain
just the required pieces.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"moondaddy" <mo*******@nospam.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
我有图像我需要阻止用户右键单击
并选择将图片另存为?我怎么能这样做?

-
mo ******* @ nospam.com
I have images that I need to prevent the user from doing a right click and selecting "Save Picture As"? How can I do this?

--
mo*******@nospam.com




任何禁用右键单击的网站都是标志一个业余网站

网站。如果您的客户不介意拥有这种声誉,请继续前进。

没有办法阻止图片被

浏览器下载。毕竟,这就是浏览器所做的事情。如果你在页面中看到它,

它已经在你的电脑上了。


-

HTH,
Kevin Spencer

..Net开发人员

微软MVP

大件物品组成

$ b" Peter Rilling"
" Peter Rilling" &LT; PE *** @ nospam.rilling.net&GT;在留言中写道

新闻:uY ************** @ TK2MSFTNGP10.phx.gbl ...
Any web site which has right-click disabled is a sign of an amateur web
site. If your clients don''t mind having that reputation, go right ahead.
There is simply no way to prevent pictures from being downloaded by the
browser. That is, after all, what a browser does. If you see it in the page,
it''s already on your computer.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
或者你可以转身关闭JavaScript和上下文菜单将始终显示。或者,您可以查看文档源,获取图像URL,并且
直接浏览浏览器。重点是在程序性限制周围获得
并不难。

最后,可能更麻烦的是限制图像的下载是值得的。您可能会做的是在图像上放置某种水印,以使该人更难以使用
a非合法的方式使用。

Alvin Bruney [ MVP] QUOT; <蒸汽邮局的蒸汽>在消息中写道
新闻:O2 ************** @ TK2MSFTNGP10.phx.gbl ...
Or you can just turn off JavaScript and the context menu will always be
shown. Or you can view the document source, get the image URLs and navigate the browser to them directly. Point being that it is not hard to get around the programmatic restrictions.

In the end, it may be more trouble then it is worth to restrict the
downloading of the images. What you might do is place some kind of
watermark on the images to make it more difficult for the person to use on a non-legitimate way.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
你无法阻止它。你可能会采取措施使其变得更加困难,但是总有办法让你了解情况。我建议你对
图片进行版权保护。如果这对你不起作用,请从
you cannot prevent it. you may take steps to make it more difficult but
there are always ways to get the picture. i''d suggest you copyright the
picture. if this doesn''t work for you, handle the oncontextmenu event from
javascript中处理oncontextmenu事件
,当单击鼠标右键时会触发该事件。那里没有菜单所以图片不会被保存....大部分都是。

一个精明的用户可以随时捕获整个屏幕并使用油漆至
只获得所需的部分。

-
问候,
Alvin Bruney [ASP.NET MVP]
得到花絮?在此处获取...
http://tinyurl.com/3he3b
moondaddy &LT;莫******* @ nospam.com&GT;在消息中写道
新闻:%2 ****************** @ TK2MSFTNGP12.phx.gbl ...
javascript which fires off when the right mouse button is clicked. there
won''t be a menu so the picture won''t be saved....for the most part.

a savvy user can always capture the entire screen and use paint to obtain just the required pieces.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"moondaddy" <mo*******@nospam.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
我有图像我需要阻止用户右键单击
I have images that I need to prevent the user from doing a right click


并选择将图片另存为?我怎么能这样做?

-
mo ******* @ nospam.com