Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.8 KiB

  1. <%
  2. '---------------Test for IE and Netscape browsers---------------
  3. dim ua
  4. dim iPosition
  5. dim iNetPosition
  6. dim iIEVer
  7. dim iNetVer
  8. dim bolNetscape
  9. dim bolIE
  10. dim strTempURL
  11. Err.Clear
  12. bolNetscape = false
  13. bolIE = false
  14. ua = Request.ServerVariables("HTTP_USER_AGENT")
  15. if InStr(ua, "Opera") > 0 then
  16. Response.Redirect("http://" & Request.ServerVariables("SERVER_NAME") & "/browserinfo.asp")
  17. end if
  18. strTempURL = Request.ServerVariables("URL")
  19. strURL = LCase(strURL)
  20. if instr(1, strURL, "status.asp") = 0 and instr(1, strURL, "state.asp") = 0 and instr(1, strURL, "comments.asp") = 0 _
  21. and instr(1, strURL, "resources.asp") = 0 and instr(1, strURL, "faq.asp") = 0 and instr(1, strURL, "welcome.asp") = 0 _
  22. and instr(1, strURL, "crashinfo.asp") = 0 and instr(1, strURL, "privacy.asp") = 0 and len(strURL) <> 0 then
  23. if InStr(ua,"Windows 95") > 0 Or InStr(ua,"Windows 98") > 0 Or InStr(ua,"Millennium") > 0 Or InStr(ua,"Windows NT 4.0") > 0then
  24. Response.Redirect("http://" & Request.ServerVariables("SERVER_NAME") & "/browserinfo.asp")
  25. end if
  26. end if
  27. iPosition = 0
  28. iPosition = Instr(1, ua, "MSIE")
  29. if cint(iPosition) <> 0 then
  30. if err.number <> 0 then
  31. Response.Redirect("http://" & Request.ServerVariables("SERVER_NAME") & "/browserinfo.asp")
  32. end if
  33. iIEVer = Mid(ua, iPosition + 5, 1)
  34. if err.number <> 0 then Response.Redirect("http://" & Request.ServerVariables("SERVER_NAME") & "/browserinfo.asp")
  35. if cint(iIEVer) < 5 and iPosition > 0 then
  36. Response.Redirect("http://" & Request.ServerVariables("SERVER_NAME") & "/browserinfo.asp")
  37. end if
  38. if err.number <> 0 then Response.Redirect("http://" & Request.ServerVariables("SERVER_NAME") & "/browserinfo.asp")
  39. bolIE = true
  40. else
  41. Response.Redirect("http://" & Request.ServerVariables("SERVER_NAME") & "/browserinfo.asp")
  42. end if
  43. %>