1

有人可以从浏览器中看到 .aspx 网站的代码隐藏吗?

有人告诉我这是可能的,但我真的找不到办法,查看页面源代码只显示演示页面..

那么有没有办法做到这一点?如何?

谢谢你

4

2 回答 2

4

不,如果没有对服务器本身的物理或远程访问,就不可能看到代码隐藏。

理论上,您也可以错误地配置 IIS 服务器以显示源文件,这将导致它们被显示,而不是被编译,但不知道为什么有人会这样做。默认情况下,IIS 不会显示它们。

于 2012-11-20T13:12:05.913 回答
3

By default, IIS shows parts of your code (aspx or code-behind) when an exception occurs - along with the call stack of the exception. Any serious ASP.NET application hides this information from users by using specific error handlers to show the error information in another (often more user-friendly) format.

As others mentioned, it's not normally possible to see the code, as it's a server-side handler, compiled and run on the server, while client only sees the HTML output.

于 2012-11-20T13:18:31.250 回答