您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

70 行
2.0KB

  1. <%
  2. Class HttpRequest
  3. Private m_Request
  4. Private Sub Class_Initialize()
  5. Set m_Request = Nothing
  6. End Sub
  7. Public Sub Bind(ByRef aspRequest)
  8. ' IsObject(Nothing) is True in VBScript, so it can't detect "no object"
  9. ' on its own - it must be paired with an explicit "Is Nothing" check.
  10. If (Not IsObject(aspRequest)) Or (aspRequest Is Nothing) Then
  11. Err.Raise vbObjectError + 1100, "HttpRequest.Bind", "aspRequest must be an object."
  12. End If
  13. Set m_Request = aspRequest
  14. End Sub
  15. Public Property Get IsBound()
  16. IsBound = Not (m_Request Is Nothing)
  17. End Property
  18. Public Function Item(ByVal key)
  19. EnsureBound "Item"
  20. Item = m_Request(CStr(key))
  21. End Function
  22. Public Function QueryString(ByVal key)
  23. EnsureBound "QueryString"
  24. QueryString = m_Request.QueryString(CStr(key))
  25. End Function
  26. Public Function Form(ByVal key)
  27. EnsureBound "Form"
  28. Form = m_Request.Form(CStr(key))
  29. End Function
  30. Public Function ServerVariable(ByVal key)
  31. EnsureBound "ServerVariable"
  32. ServerVariable = m_Request.ServerVariables(CStr(key))
  33. End Function
  34. Public Function Cookie(ByVal key)
  35. EnsureBound "Cookie"
  36. Cookie = m_Request.Cookies(CStr(key))
  37. End Function
  38. Public Function ClientCertificate(ByVal key)
  39. EnsureBound "ClientCertificate"
  40. ClientCertificate = m_Request.ClientCertificate(CStr(key))
  41. End Function
  42. Public Property Get TotalBytes()
  43. EnsureBound "TotalBytes"
  44. TotalBytes = m_Request.TotalBytes
  45. End Property
  46. Public Function BinaryRead(ByVal count)
  47. EnsureBound "BinaryRead"
  48. BinaryRead = m_Request.BinaryRead(CLng(count))
  49. End Function
  50. Private Sub EnsureBound(ByVal memberName)
  51. If m_Request Is Nothing Then
  52. Err.Raise vbObjectError + 1101, "HttpRequest." & CStr(memberName), "ASP Request object has not been bound."
  53. End If
  54. End Sub
  55. End Class
  56. %>

Powered by TurnKey Linux.