⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soft_down.asp

📁 该程序是初学者最好用的程序!~欢迎大家使用 QQ:68056085
💻 ASP
字号:
<!--#include FILE="conn.asp"-->
<%On Error Resume Next 
check=cstr(session("downmid"))=cstr(request("downmid"))
check=Lcase(check)
If session("downmid")="" or check="false" Then
Response.redirect "index.asp"
end If

sq1="select * from article where articleid="&request("id")
Set Rs1 = Server.CreateObject("Adodb.Recordset")
rs1.open sq1,conn,1,2
path=rs1("datadir")
rs1.close
Set rs1=Nothing
set rs=server.createobject("adodb.recordset")
sql="update article set hits=hits+1 where articleID="&request("id")
rs.open sql,conn,1,3
rs.close
Set rs=Nothing

Response.Buffer = true 
Response.Clear 
dim url 
Dim fso,fl,flsize 
dim Dname 
Dim objStream,ContentType,flName,isre,url1 
Dname=trim(request("n")) 
If Dname<>"" Then 
url=server.MapPath("/")&"\"&path
End If 
Set fso=Server.CreateObject("Scripting.FileSystemObject") 
Set fl=fso.getfile(url) 
flsize=fl.size 
flName=fl.name 
Set fl=Nothing 
Set fso=Nothing 
%> 
<% 
Set objStream = Server.CreateObject("ADODB.Stream") 
objStream.Open 
objStream.Type = 1 
objStream.LoadFromFile url 
Select Case lcase(Right(flName, 4)) 
Case ".ota" 
ContentType = "image/vnd.nokia.ota-bitmap"
Case ".jad" 
ContentType = "text/vnd.sun.j2me.app-descriptor"
Case ".jar" 
ContentType = "application/java-archive"
Case ".rng" 
ContentType = "application/vnd.Nokie.ringing-tone"
Case ".sis" 
ContentType = "application/vnd.symbian.install"
Case ".rar" 
ContentType = "application/x-rar-compressed"
Case ".exe" 
ContentType = "application/octet-stream"
Case ".avi" 
ContentType = "video/avi" 
Case ".zip" 
ContentType = "application/zip" 
Case ".gif" 
ContentType = "image/gif" 
Case ".jpg", "jpeg" 
ContentType = "image/jpeg" 
Case ".wav" 
ContentType = "audio/wav" 
Case ".mp3" 
ContentType = "audio/mpeg3" 
Case ".mpg", "mpeg" 
ContentType = "video/mpeg" 
Case Else 
ContentType = "application/octet-stream" 
End Select 
Response.AddHeader "Content-Disposition", "attachment; filename=" & flName 
Response.AddHeader "Content-Length", flsize 
Response.Charset = "UTF-8" 
Response.ContentType = ContentType 
Response.BinaryWrite objStream.Read 
Response.Flush 
response.Clear() 
objStream.Close 
Set objStream = Nothing 
%> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -