简体   繁体   English

我可以在没有http Handler的情况下隐藏asp.net页面上的图像路径吗?

[英]Can I hide an image path on asp.net page without http Handler?

I have many static images under a directory in my site structure, and I'm not concerned with hotlinking or copy-protecting the images. 我的网站结构中的目录下有很多静态图像,我不关心图像的热链接或复制保护。 For a myriad of reasons, what I need to do is not show the image path on the site (or show a fake one). 由于种种原因,我需要做的是不在网站上显示图像路径(或显示虚假路径)。

Is there any way to do this without resorting to an http handler or a worker asp.net page? 有没有办法做到这一点,而不诉诸http处理程序或工作者asp.net页面?

You could use URL Rewritting . 您可以使用URL重写 Doing it yourself would require you to implement a custom handler but there are third party options already available you could try. 自己动手将要求您实现自定义处理程序,但您可以尝试使用第三方选项。

I would guess however that a simple http handler implemented as an ASHX endpoint would probably be the easiest option. 但我猜想,作为ASHX端点实现的简单http处理程序可能是最简单的选择。

您可以使用通用的ASHX处理程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 基于特定文件夹路径的asp.net mvc http处理程序 - asp.net mvc http handler based on specific folder path 在ASP.NET中使用HTTP处理程序生成要在电子邮件中显示的图像 - Using an HTTP handler in ASP.NET to generate an image for display in email ASP.NET HTTP处理程序无法识别的请求 - ASP.NET HTTP Handler Unrecognized Request 如何在没有母版页的情况下在 asp.net 中打印页面并更改页面的配色方案? - How can i print a page in asp.net without master page and to change color schemes of the page? 如何在我的控制器(ASP.NET MVC)中调用Http Handler文件(.ashx)中定义的方法? - How can I call a method that's defined in an Http Handler file (.ashx) in my controller (ASP.NET MVC)? ASP.NET在ashx处理程序中保存图像 - ASP.NET Save Image in ashx handler 如何在C#/ ASP.NET中的http://someurl/myimage.jpg中检查图像是否存在 - How can I check if an Image exists at http://someurl/myimage.jpg in C#/ASP.NET 我如何更改点击 asp.net 动态内容的图像路径 - How can i change image path on click for asp.net dynamic content 没有 HTTP 动词的 ASP.NET Core 错误处理程序引发 Swashbuckle 异常 - ASP.NET Core error handler without HTTP verb throws Swashbuckle exception 如何在具有相似路径但有多个页面处理程序的asp.net Web表单中处理URL路由 - How to handler url routing in asp.net webforms with similar path but multiple Page Handlers
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM