易截截图软件、单文件、免安装、纯绿色、仅160KB

Asp中隐藏下载地址

<%
Response.Buffer = true
Response.Clear
dim url
Dim fso,fl,flsize
dim Dname
Dim objStream,ContentType,flName,isre,url1
Dim strFileName
strFileName=replace(replace(Request("file"),"\",""),"/","")  '传参
strFileName="/files/"&strFileName    ' 改成你你文件的存放路径
If strFileName<>"" Then
'******************************下载文件存放的服务端目录
url=Server.MapPath(strFileName)
else
    Response.Write("no found")
    Response.end 
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 ".asf"
ContentType = "video/x-ms-asf"
Case ".avi"
ContentType = "video/avi"
Case ".doc"
ContentType = "application/msword"
Case ".zip"
ContentType = "application/zip"
Case ".xls"
ContentType = "application/vnd.ms-excel"
Case ".gif"
ContentType = "image/gif"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
Case ".bmp"
ContentType = "image/bmp"
Case ".ppt"
ContentType = "application/vnd.ms-powerpoint"
Case ".mdb"
ContentType = "application/x-msaccess"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html" ,"htm(1)"
ContentType = "text/html"
Case ".txt"
ContentType = "text/plain"
Case Else
ContentType = "application/octet-stream"
End Select
'  我是用UPload组件上传的,如果重名会产生"(数字)" 后缀,
'  有些主机会阻止下载这类文件,所以这里加一个检查,将Upload组件自动生成的后缀
If InStr(lcase(Right(flName, 1)),")") Then
 flName=mid(flName,1,Len(flName)-3)
End If
Response.AddHeader "Content-Disposition", "attachment; filename=" &


相关文档:

使用Asp操作数据库

1.通过ODBC或者OLE方式连接的区别?

现在有两种连接数据库的方法。一方面,可以用ODBC产生一个连接,这种连接与任何有ODBC驱动器的数据库(即基本上是市场上所有的数据库)兼容;另一方面,可以用原始OLE DB提供商产生一个连接。

该用哪个提供商?尽可能用原始OLE DB提供商,因为它提供了对数据更有效的访 ......

如何选择虚拟主机(asp,php篇)2

上次写到asp,php空间有关数据库选择的问题。对于数据库的搭配 一般是这样 asp+access/ asp+sql server,然后是php+mysql。access是可以和网页空间共享大小的,而sql server 和mysql是要单独购买的。对于一般的小应用,用asp+access就可以搞定了。或者是.net+access。 这些 几乎就不要考虑数据库成本了。但是使用php的话,就 ......

用Dreamweaver实现ASP动态网站建设

Macromedia Dreamweaver MX 是一款专业的 HTML 编辑器,用于对 Web 站点、Web 页和 Web 应用程序进行设计、编码和开发。无论您愿意享受手工编写 HTML 代码时的驾驭感还是偏爱在可视化编辑环境中工作,Dreamweaver 都会为您提供有用的工具,使您拥有更加完美的 Web 创作体验。 Dreamweaver 使您可以使用服务器技术(例如 CFML ......

ASP.NET之五 ASP.NET对象

session
===================================
session对象用于存储特定的用户会话所需的信息 。 Session对象的引入是为了弥补HTTP协议的不足,HTTP协议是一种无状态的协议。
  Session中文是“会话”的意思,在ASP中代表了服务器与客户端之间的“会话”。Session的作用时间从用户到达某个特定的 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号