如何在右键菜单中禁用视图源? [英] How to disable the view source in right click menu?

查看:78
本文介绍了如何在右键菜单中禁用视图源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在右键菜单中禁用查看源代码"选项?
我不想将我的代码访问未经授权的成员.

how to disable the view source option in right click menu?
I want not access the my code to unauthorized member.
How to resolve it?

推荐答案

没有什么可以解决的.这不仅是不可能的.整个想法没有任何意义.

要合乎逻辑.您的服务器端发送一些答复以响应HTTP请求.在客户端的Web浏览器加载页面时,HTTP服务器无法控制客户端-直到下一个HTTP请求为止.网页内容已经交付;客户可以用它做任何事情;现在禁用任何东西为时已晚.

查看页面的源代码与查看页面本身相同,只是以其未渲染的原始文本形式.

—SA
There is nothing to resolve. Not only this is impossible; the whole idea makes no sense.

Be logical. You server side sends some reply in response to HTTP request. By the time the page is loaded by the client''s Web browser, HTTP server has no control over client — until next HTTP request. The Web page content is already delivered; the client can do with it anything at all; it''s too late to disable anything.

Viewing source code of the page is the same as looking at the page itself, only in it''s raw un-rendered text form.

—SA


使用javascript禁用页面上的右键单击,除非没有其他简单的选择可以这样做.



您可以在C#文件上使用所有html代码.但对于初学者或中级人员来说并不容易.
use javascript to disable right click on page unless there is no any other easy option to do that.

or

u can use all html codes on C# file.but its not easy for beginners or intermediate.


这篇关于如何在右键菜单中禁用视图源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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