ASP开发中碰到的一段代码:
Sub subCacheControl()
    Dim strBrowseType
    
    Set strBrowseType = Request.ServerVariables("HTTP_USER_AGENT")
    
    If InStr(strBrowseType, "IE") > 0 Then
        Response.addHeader "Expires", "0"
        Response.addHeader "Pragma", "no-cache"
        Response.addHeader "Cache-Control", "no-cache"
        Response.addHeader "Cache-Control", "no-store"
    End IfEnd Sub
我想请问这实现了什么功能.最好详细一点.谢谢!

解决方案 »

  1.   

    判断客户端使用的浏览器类型是否是IE,然后设置表头信息请看
    http://neural.cs.nthu.edu.tw/jang/books/webprog/06asp/response.asp?SessionCount=5
      

  2.   

    Sub subCacheControl()
        Dim strBrowseType
        
        Set strBrowseType = Request.ServerVariables("HTTP_USER_AGENT")
    '用于在取得请求中HTTP_USER_AGENT客户端的类型
        
        If InStr(strBrowseType, "IE") > 0 Then
            Response.addHeader "Expires", "0"
            Response.addHeader "Pragma", "no-cache"
            Response.addHeader "Cache-Control", "no-cache"
            Response.addHeader "Cache-Control", "no-store"
        End If
    '如果是IE则在响应的中加入上述控控制头。End Sub
      

  3.   

    Set strBrowseType = Request.ServerVariables("HTTP_USER_AGENT")
    'Set 似乎可以不要。因为返回的并不是对象。