日期:2010-05-24 09:08:00 来源:本站整理
<b>asp防盗链函数源代码</b>[网站编程]
本文“<b>asp防盗链函数源代码</b>[网站编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
若何躲藏下载地址及防盗链,看以下的“asp防盗链函数代码”
- <% FunctIon DownloadFIle(StrFIle)
- StrFIleStrFIlename=StrFIle
- Response.Buffer=True
- Response.Clear
- Set S=Server.CreateObJect("ADODB.Stream")
- S.Open
- S.Type=1
- on Error Resume Next
- Set Fso=Server.CreateObJect("ScrIptIng.FIleSystemObJect")
- If Not Fso.FIleExists(StrFIleName) Then
- From_Url=Cstr(Request.ServerVarIables("HTTP_REFERER"))
- Serv_Url=Cstr(Request.ServerVarIables("SERVER_NAME"))
- If MId(From_Url,8,len(Serv_Url)) <> Serv_Url Then
- Response.WrIte "该文件不存在大概已经删除."
- Response.End
- End If
- Response.RedIrect Request.ServerVarIables("HTTP_REFERER")
- Response.End
- End If
- FileExt=MId(StrFIlename,InStrRev(StrFIleName, ".")+1)
- Select Case UCase(FIleExt)
- Case "ASP", "ASA", "ASPX", "ASAX", "MDB", "PHP", "JSP", "SHTML", "HTML", "HTM", "TV", "DATA"
- From_Url=Cstr(Request.ServerVarIables("HTTP_REFERER"))
- Serv_Url=Cstr(Request.ServerVarIables("SERVER_NAME"))
- If MId(From_Url,8,len(Serv_Url)) <> Serv_Url Then
- Response.WrIte "该文件不存在大概已经删除."
- Response.End
- End If
- Response.RedIrect Request.ServerVarIables("HTTP_REFERER")
- Response.End
- End Select
- Set F=Fso.GetFIle(StrFIlename)
- IntFIlelength=F.SIze
- s.LoadFromFIle(StrFIlename)
- If Err Then
- From_Url=Cstr(Request.ServerVarIables("HTTP_REFERER"))
- Serv_Url=Cstr(Request.ServerVarIables("SERVER_NAME"))
- If MId(From_Url,8,len(Serv_Url)) <> Serv_Url Then
- Response.WrIte "该文件数据不完好大概已破坏."
- Response.End
- End If
- Response.RedIrect Request.ServerVarIables("HTTP_REFERER")
- Response.End
- End If
- Set Upload=Server.CreateObJect("PersIts.Upload")
- If Upload Is Nothing Then
- Response.AddHeader "Content-DIsposItIon","attachment; FIlename="&F.Name
- Response.AddHeader "Content-Length",IntFilelength
- Response.CharSet="UTF-8"
- Response.ContentType="application/x-download"
- Response.BinaryWrite S.Read
- Response.Flush
- S.Close
- Set s=NothIng
- Else
- Upload.SendBinary StrFIlename,True,"application/x-download",False
- End If
- End FunctIon
- %>
利用
- <%Call DownloadFIle("下载地址")%>
以上是“<b>asp防盗链函数源代码</b>[网站编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |
评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论