防盗链的问题 如题,如果已经在网站上设置了反盗链的处理,然后,我在本地测试,还是可以用站的图片,比如 在VS中<asp:Image ID="Image1" runat="server" ImageUrl="http://www.XXYY.com/image/logo.jpg" />,不会弹出一个提示盗链的消息 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public void ProcessRequest(HttpContext context) { if (context.Request.UrlReferrer.Host == "localhost") { context.Response.Expires = 0; context.Response.Clear(); context.Response.ContentType = "image/jpg"; context.Response.WriteFile(context.Request.PhysicalPath); context.Response.End(); } else { context.Response.Expires = 0; context.Response.Clear(); context.Response.ContentType = "image/jpg"; context.Response.WriteFile(context.Request.PhysicalApplicationPath + "images/error.jpg"); context.Response.End(); } 改成UrlReferrer.AbsolutePath.StartsWith("localhost")呢?我忘了。 唉,要我说,除非你们家BOSS强烈要求,否则,盗链对你来说,只有好处哪里有坏处。个人建议,不要舍本逐末了。 求.net DX第三方控件中文帮助文档 求一些经典asp.net项目 请问怎么让menu动起来? 困扰一下午webservice的调用问题 时间转化 急!!!在ASP.net中怎样实现图片上传??? 如何使用asp.net 获取活动目录中的用户信息 repeater怎么实现这样的版面?? 我有这么一个问题,在线等待 请问那里有好的 DropDownList 控件下载 asp.net页面下载按钮不能下载指定文件,而是把整个ashx页面下载了 截取字符串的问题。。。
{
if (context.Request.UrlReferrer.Host == "localhost")
{
context.Response.Expires = 0;
context.Response.Clear();
context.Response.ContentType = "image/jpg";
context.Response.WriteFile(context.Request.PhysicalPath);
context.Response.End();
} else
{
context.Response.Expires = 0;
context.Response.Clear();
context.Response.ContentType = "image/jpg";
context.Response.WriteFile(context.Request.PhysicalApplicationPath + "images/error.jpg");
context.Response.End(); }
个人建议,不要舍本逐末了。