我需要一个记录软件下载次数的计数器,我很菜,大家教教我怎样实现啊! 如果下载地址是直接链接的文件路径,那么可以用onclick等事件触发js代码,然后由js代码负责触发服务器代码进行下载次数统计。也可以用流下载的方式,这样更容易做下载统计 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 也可以用流下载的方式,这样更容易做下载统计推荐使用stream下载方式更容易控制 <%@ Language=VBScript %> <% Response.buffer = TRUE response.contenttype="application/msword" Response.AddHeader "Content-Disposition","attachment;filename=mainmenu.doc" Dim varStream, oMyObject const adtypebinary = 1 dim strfilepath strfilepath = "c:\a.doc" '文件名可以传递进来,在这里统计下载次数比较准确'调用次数的统计 set objstream = server.createobject("adodb.stream") objstream.open objstream.type = adtypebinary objstream.loadfromfile strfilepath response.binarywrite objstream.read objstream.close set objstream = nothing %> 去读取 iis日志 比较好 去读取 iis日志 比较好 msxml3.dll:指定资源下载失败 帮忙看一下一段js代码 关于YAHOO.widget.Overlay在IE中的层覆盖问题 正则问题 select option的问题,类似于title的效果 JSP页面如何做到客户端统计 求 EMAIL检验的正则表达式 一个简单的问题----关于创体的滚动条 请问个表单限制问题! mm求助:IE打印,好急哟!!! 用js将html代码写到div里面去 javascript遍历表格
推荐使用stream下载方式
更容易控制
<%
Response.buffer = TRUE
response.contenttype="application/msword"
Response.AddHeader "Content-Disposition","attachment;filename=mainmenu.doc"
Dim varStream, oMyObject
const adtypebinary = 1
dim strfilepath
strfilepath = "c:\a.doc"
'文件名可以传递进来,在这里统计下载次数比较准确
'调用次数的统计
set objstream = server.createobject("adodb.stream")
objstream.open
objstream.type = adtypebinary
objstream.loadfromfile strfilepath
response.binarywrite objstream.read
objstream.close
set objstream = nothing
%>