我需要一个记录软件下载次数的计数器,我很菜,大家教教我怎样实现啊! 如果下载地址是直接链接的文件路径,那么可以用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日志 比较好 抓取网页源代码遇到的难题! 怎样在表单里提交Script变量? javascript 怎么取页面上图片的绝对坐标? 怎么屏蔽到ie里的查找功能(ctrl+F)~! 日期格式转换例如:2006-4-30 转换为:二OO六年四月三十日 greybox页面传值 新人求助 难问题:请大家和高手来看看,如何不刷新取得这个值!!!!!!!!!!!!!!! 请问,怎样在JS中比较两个时间串的大小呢? 用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
%>