home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / vb5pwr.cls < prev    next >
Text File  |  1997-10-25  |  2KB  |  68 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "VB5Power"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = True
  10.  
  11. Option Explicit
  12.  
  13. Dim gsmyProperty As String
  14.  
  15.     
  16. Private Sub Class_Initialize()
  17.     
  18.     gsmyProperty = "Visual Basic 5 Power Component"
  19.     
  20. End Sub
  21.  
  22. Public Property Get myProperty() As String
  23.     
  24.     myProperty = gsmyProperty
  25.     
  26. End Property
  27.  
  28. Public Property Let myProperty(ByVal sNewValue As String)
  29.     
  30.     gsmyProperty = sNewValue
  31.     
  32. End Property
  33.  
  34. Public Function myMethod(ByVal myString As String) As String
  35.  
  36.     myMethod = UCase(myString)
  37.     
  38. End Function
  39.  
  40.  
  41. Public Sub myPowerMethod()
  42.  
  43.     Dim objResponse As Response
  44.     Dim objRequest As Request
  45.     Dim objContext As ObjectContext
  46.     
  47.     Set objContext = GetObjectContext()
  48.     Set objResponse = objContext("Response")
  49.     Set objRequest = objContext("Request")
  50.     
  51.     If InStr(objRequest.ServerVariables("HTTP_USER_AGENT"), "MSIE") > 0 Then
  52.         objResponse.Write "You are using a very powerful browser."
  53.     Else
  54.         objResponse.Write "Try Internet Explorer today!"
  55.     End If
  56.     
  57. End Sub
  58.  
  59. Public Property Get myPowerProperty() As String
  60.     
  61.     Dim objRequest As Request
  62.     Dim objContext As ObjectContext
  63.     Set objContext = GetObjectContext()
  64.     Set objRequest = objContext("Request")
  65.     
  66.     myPowerProperty = objRequest("SCRIPT_NAME")
  67. End Property
  68.