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

asp文件下载

 <%
If Not IsNull(Request("fileName")) Then r = DownLoadFile(Request("fileName"))
Function DownLoadFile(fileName)
Dim s,fso,f,fLen
fileName = Server.MapPath(fileName)
'create stream
Set s = Server.CreateObject("ADODB.Stream")
s.Open()
s.Type = 1
Set fso = Server.CreateObject("Scripting.FileSystemObject")

If Not fso.FileExists(fileName) Then Response.Write "文件不存在" : Response.End
Set f = fso.GetFile(fileName)
fLen = f.Size
s.LoadfromFile(fileName)

'clear the buffer
Response.Buffer = True
Response.Clear()
Response.AddHeader"Content-Disposition","attachment;filename=" & f.name
Response.AddHeader"Content-Length",fLen
Response.CharSet = "UTF-8"
Response.ContentType = "application/octet-stream"
'output the file to the browser
Response.BinaryWrite s.Read
Response.Flush


s.Close
Set s = Nothing
Set fso = Nothing
End Function
%>


相关文档:

ASp连接数据库

1. ASP连接Access数据库语句
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("www/bbs.mdb")+";DefaultDir=;DRIVER={Microsoft
AccessDriver(*.mdb)};"
Conn.Open connstr
其中Set Conn=Server.CreateObject("ADODB.Connection")为建立一个访问数据的对象
server.mappath("w ......

关于ASP Recordset 分页出现负数解决方法及建议


对于Recordset分页时出现负数的现象,相信会有很多人遇到过这个问题,有时百度、GOOGLE也不得其解,现在由我来总结一下。
出现负数,主要和游标类型有关系。(为举例方便,假设已经有一个conn.asp链接数据库的文件并且已经include)现在举一个例子,代码如下:
'===================================================== ......

解决ASP不能更新,数据库或对象为只读的问题

最近帮别人处理下数据,发现添加数据时,就提示"ASP 不能更新。数据库或对象为只读。",从网上找了,也没有解决我的问题.
1、服务器的数据目录mdb文件所在的目录,是只读的
2、数据库在本地的权限,去只读权限,再上传
3、有可能你是从只读目录移动到可读目录的,所以一定不能这么用,先下到本地,再上传,可解决此类问 ......

淘特搜索引擎在淘特Asp Cms下的应用


1、首先下载淘特站内搜索引擎,首先要导入CMS中的数据到搜索引擎索引中,这个工作您可以放到本地来做,索引后,直接将淘特搜索引擎文件夹压缩后上传到您的空间上即可。
2、数据索引说明:
3、首先在本地部署一个asp.net环境,然后安装淘特站内搜索引擎,假如访问地址是:http://localhost。
4、下面输入地址:http://lo ......

ASP验证码代码

将以下代码放到一个单独的页面checkcode.asp
<%
Option Explicit
Response.buffer=true
Call Com_CreatValidCode("validateCode")
Sub Com_CreatValidCode(pSN)
' 禁止缓存
Response.Expires = -9999
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "cache-ctrol","no-cache"
Response.ContentTy ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号