C#防盗链处理类的代码
2021-06-06 17:03
标签:oid 处理 oca app and ext efi return ref 如下的内容是关于C#防盗链处理类的内容。 public void ProcessRequest(HttpContext context) HttpResponse response = context.Response; } C#防盗链处理类的代码 标签:oid 处理 oca app and ext efi return ref 原文地址:https://www.cnblogs.com/tozgb/p/10774624.html
public class FileHandler:IHttpHandler
{
public FileHandler()
{
}
{
if ((context.Request.UrlReferrer == null) || (context.Request.UrlReferrer.Host == "localhost" && context.Request.UrlReferrer.Port == 16490))
{
context.Response.Expires = 0;
context.Response.Clear();
context.Response.ContentType = "rar";
context.Response.WriteFile(context.Request.PhysicalPath);
context.Response.End();
}
{
response.Redirect(context.Request.ApplicationPath + "/ErrorPage.htm");
}
public bool IsReusable
{
get
{
return false;
}
}
}