且构网

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

提供asp.net Web应用程序时隐藏代码.

更新时间:2022-11-06 15:11:08

情况很简单:服务器部分发生什么,不需要任何保护,因为它确实从客户的角度来看,甚至不存在.顾名思义,客户端部分的所有内容始终都是完全开放的.服务器部分用于生成内容,该内容将完全下载到客户端.在您尝试执行任何操作之前,用户已经拥有了它.因此,您无法在客户端部分上隐藏任何内容.

但是,您可以对其进行混淆,但要注意两点:为什么?您是否认为您有一些重要的知识要知道任何人都愿意去复印?无论如何,如果您有这样的秘密内容,请考虑在服务器端实现它.

—SA
The situation is very simple: what happens on the server part, does not need any protection, because it does not even exist, from the client''s point of view. And everything on the client part is always fully open, by definition. The server part is used to generate the content which is downloaded to the client side fully. Before you try to do anything, the user already has it. So, you cannot hide anything on the client part.

However, you can obfuscate it, but thing twice about it: why? Do you think you have some important know how that anyone would bother to copy? Anyway, if you have such secret stuff, think about implementing it on the server side.

—SA



您可以先发布网站,然后再将其提供给客户.
请遵循此链接中给出的步骤:
MSDN:演练:使用发布网站工具部署网站项目 [ ^ ]
MSDN:如何:使用发布网站工具部署网站项目 [ ^ ]

--Amit
Hi,
You can just publish your website before giving it to your client.
Follow the steps given in this link:
MSDN : Walkthrough: Deploying a Web Site Project by Using the Publish Web Site Tool[^]
MSDN : How to: Deploy a Web Site Project by Using the Publish Web Site Tool[^]

--Amit


如果要创建Web应用程序而不是网站
进行构建->发布

此选项将使您的代码成为dll文件,即您的网站仅包含aspx页面+ bin文件夹中的一个dll,不应有任何aspx.cs文件
If you are creating a web application instead of website
Go to build -> Publish

This option will make your code as dll file ie your website only contains aspx page + one dll in your bin folder there should not be any aspx.cs file