如果下载地址是直接链接的文件路径,那么可以用onclick等事件触发js代码,然后由js代码负责触发服务器代码进行下载次数统计。也可以用流下载的方式,这样更容易做下载统计

解决方案 »

  1.   

    也可以用流下载的方式,这样更容易做下载统计
    推荐使用stream下载方式
    更容易控制
      

  2.   

    <%@   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               
                                %>   
      

  3.   

    去读取 iis日志 比较好
      

  4.   

    去读取   iis日志   比较好