简体   繁体   中英

hide html page source

有什么方法可以隐藏asp.net页面视图源吗?

If you mean, can you hide your ASP.NET code : it's not visible in View Source.

If you mean can you hide your HTML : you can discourage casual peeking by creating your HTML on the fly via Javascript or AJAX, but a developer will always be able to see what you are doing, using simple tools like Firebug and Fiddler.

Edited to add:

I wasn't thinking of obfuscation (though that also discourages casual peeking), I was thinking of using javascript to pull down HTML. Doing a View Source will only show a bunch of <SCRIPT> tags.

But it appears his question has been revised to go in a different direction anyway, to can I keep people from downloading my images , and the answer to that is a simple no . Making money from small numbers of images is not a viable business model. (If you have thousands of images, that's another story.)

Edited to add:

The conventional way of making a catalog of photographs is to [a] show low-resolution previews, [b] put a watermark on each image ( here's an example ), or both.

Are you talking about ASP.NET or the result? Since ASP.NET is server-sided, it simply returns HTML. Basically, your ASP.NET file is processed by the server and variables and functions are converted into HTML. Your users can view the HTML but not the ASP.NET as it resides on server.

No, there is no way to hide the html source of a page. It's just not possible. There are tools that will promise the ability to do this, but don't believe them. Consider that it might not even be a traditional web browser that downloads the html.

What you can do is obfuscate it a bit, but even that is trivial to reverse.

No, you can't hide HTML, and there's no point either. There's nothing of value in the HTML. It would take maybe a couple hours for a skilled developer to replicate the look and feel of a website without even glancing at the HTML. In fact, it would probably be easier for him to do it his way.

The ASP/code-behind, however, already isn't visible. It's processed on the server and outputs HTML. Only the HTML (and CSS etc.) makes it to the client.


Reading the comments, it appears you want to prevent users from downloading your images. You can't really do that either. You can make it a lot more difficult for users to download them by embedding the images in Flash, or a Java applet, or something like that, but a determined thief could still decompile it and nab your image. Easier yet, he could just take a screenshot and save it out.

The best you can do is restrict access to the image to only certain users by making the image source point to a script instead that runs some validation before outputting the image.

This is not true you can hide source code. One way would be to write a loop that puts a 100k /n in the source code at the top. So it will push it so far down with white space that you can see it :-)

Where there is a problem there is a way.

And for all those who dont like this. Amazon used to hide there code somehow until sometime back.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM