#If _MyType <> "Empty" Then
Namespace My
'''
''' 用于定义 Web 项目的“我的命名空间”中可用属性的模块。
'''
'''
_
Module MyWebExtension
Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.ServerComputer)
Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser)
Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog)
'''
''' 返回有关主机算机的信息。
'''
_
Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.ServerComputer
Get
Return s_Computer.GetInstance()
End Get
End Property
'''
''' 返回当前 Web 用户的信息。
'''
_
Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser
Get
Return s_User.GetInstance()
End Get
End Property
'''
''' 返回 Request 对象。
'''
_
_
Friend ReadOnly Property Request() As Global.System.Web.HttpRequest
_
Get
Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current
If CurrentContext IsNot Nothing Then
Return CurrentContext.Request
End If
Return Nothing
End Get
End Property
'''
''' 返回 Response 对象。
'''
_
_
Friend ReadOnly Property Response() As Global.System.Web.HttpResponse
_
Get
Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current
If CurrentContext IsNot Nothing Then
Return CurrentContext.Response
End If
Return Nothing
End Get
End Property
'''
''' 返回 Asp 日志对象。
'''
_
Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog
Get
Return s_Log.GetInstance()
End Get
End Property
End Module
End Namespace
#End If