#Region "asp2dotnet converter header"
' Source file: "file://vb6.vb"
' Source MD5: d90ad8c5cd2f6b73fb32c0717ec76683
' Original Modified: 2015-10-25T17:51:10.000Z
' Date Converted: 2017-07-26T20:45:30.580Z
' File Protected: false
#End Region

Public Class Vb6

	Inherits PageClass

	#Region "Global Constants"

	' No value
	Public Const adEmpty As Integer                  = 0

	' A 2-byte signed integer.
	Public Const adSmallInt As Integer               = 2

	' A 4-byte signed integer.
	Public Const adInteger As Integer                = 3

	' A single-precision floating-point value.
	Public Const adSingle As Integer                 = 4

	' A double-precision floating-point value.
	Public Const adDouble As Integer                 = 5

	' A currency value
	Public Const adCurrency As Integer               = 6

	' The number of days since December 30, 1899 + the fraction of a day.
	Public Const adDate As Integer                   = 7

	' A null-terminated character string.
	Public Const adBSTR As Integer                   = 8

	' A pointer to an IDispatch interface on a COM object. Note: Currently not supported by ADO.
	Public Const adIDispatch As Integer              = 9

	' A 32-bit error code
	Public Const adError As Integer                  = 10

	' A boolean value.
	Public Const adBoolean As Integer                = 11

	' An Automation Variant. Note: Currently not supported by ADO.
	Public Const adVariant As Integer                = 12

	' A pointer to an IUnknown interface on a COM object. Note: Currently not supported by ADO.
	Public Const adIUnknown As Integer               = 13

	' An exact numeric value with a fixed precision and scale.
	Public Const adDecimal As Integer                = 14

	' A 1-byte signed integer.
	Public Const adTinyInt As Integer                = 16

	' A 1-byte unsigned integer.
	Public Const adUnsignedTinyInt As Integer        = 17

	' A 2-byte unsigned integer.
	Public Const adUnsignedSmallInt As Integer       = 18

	' A 4-byte unsigned integer.
	Public Const adUnsignedInt As Integer            = 19

	' An 8-byte signed integer.
	Public Const adBigInt As Integer                 = 20

	' An 8-byte unsigned integer.
	Public Const adUnsignedBigInt As Integer         = 21

	' The number of 100-nanosecond intervals since January 1,1601
	Public Const adFileTime As Integer               = 64

	' A globally unique identifier (GUID)
	Public Const adGUID As Integer                   = 72

	' A binary value.
	Public Const adBinary As Integer                 = 128

	' A string value.
	Public Const adChar As Integer                   = 129

	' A null-terminated Unicode character string.
	Public Const adWChar As Integer                  = 130

	' An exact numeric value with a fixed precision and scale.
	Public Const adNumeric As Integer                = 131

	' A user-defined variable.
	Public Const adUserDefined As Integer            = 132

	' A date value (yyyymmdd).
	Public Const adDBDate As Integer                 = 133

	' A time value (hhmmss).
	Public Const adDBTime As Integer                 = 134

	' A date/time stamp (yyyymmddhhmmss plus a fraction in billionths).
	Public Const adDBTimeStamp As Integer            = 135

	' A 4-byte chapter value that identifies rows in a child rowset
	Public Const adChapter As Integer                = 136

	' An Automation PROPVARIANT.
	Public Const adPropVariant As Integer            = 138

	' A numeric value (Parameter object only).
	Public Const adVarNumeric As Integer             = 139

	' A string value (Parameter object only).
	Public Const adVarChar As Integer                = 200

	' A long string value.
	Public Const adLongVarChar As Integer            = 201

	' A null-terminated Unicode character string.
	Public Const adVarWChar As Integer               = 202

	' A long null-terminated Unicode string value.
	Public Const adLongVarWChar As Integer           = 203

	' A binary value (Parameter object only).
	Public Const adVarBinary As Integer              = 204

	' A long binary value.
	Public Const adLongVarBinary As Integer          = 205

	' A flag value combined with another data type constant. Indicates an array of that other data type.
	Public Const AdArray As Integer                  = 8192

	' Direction unknown
	Public Const adParamUnknown As Integer           = 0

	' Default. Input parameter
	Public Const adParamInput As Integer             = 1

	' Input and output parameter
	Public Const adParamInputOutput As Integer       = 3

	' Output parameter
	Public Const adParamOutput As Integer            = 2

	' Return value
	Public Const adParamReturnValue As Integer       = 4

	' Does not specify the command type argument.
	Public Const adCmdUnspecified As Integer         = -1

	' Evaluates CommandText as a textual definition of a command or stored procedure call.
	Public Const adCmdText As Integer                = 1

	' Evaluates CommandText as a table name whose columns are all returned by an internally generated sSqlString query.
	Public Const adCmdTable As Integer               = 2

	' Evaluates CommandText as a stored procedure name.
	Public Const adCmdStoredProc As Integer          = 4

	' Default. Indicates that the type of command in the CommandText property is not known.
	Public Const adCmdUnknown As Integer             = 8

	' Evaluates CommandText as the file name of a persistently stored Recordset. Used with Recordset.Open or Requery only.
	Public Const adCmdFile As Integer                = 256

	' Evaluates CommandText as a table name whose columns are all returned. Used with Recordset.Open or Requery only. To use the Seek method, the Recordset must be opened with adCmdTableDirect. This value cannot be combined with the ExecuteOptionEnum value adAsyncExecute.
	Public Const adCmdTableDirect As Integer         = 512
	Public Const adAsyncExecute As Object            = 16
	Public Const adAsyncFetch As Object              = 32
	Public Const adAsyncFetchNonBlocking As Object   = 64
	Public Const adExecuteNoRecords As Object        = 128
	Public Const adExecuteStream As Object           = 1024
	Public Const adPersistADTG As Object             = 0
	Public Const adPersistXML As Object              = 1
	Public Const adPersistADO As Object              = 1
	Public Const adPersistProviderSpecific As Object = 2

	' Permissions have not been set or cannot be determined.
	Public Const adModeUnknown As Integer            = 0

	' Read-only.
	Public Const adModeRead As Integer               = 1

	' Write-only.
	Public Const adModeWrite As Integer              = 2

	' Read/write.
	Public Const adModeReadWrite As Integer          = 3

	' Prevents others from opening a connection with read permissions.
	Public Const adModeShareDenyRead As Integer      = 4

	' Prevents others from opening a connection with write permissions.
	Public Const adModeShareDenyWrite As Integer     = 8

	' Prevents others from opening a connection.
	Public Const adModeShareExclusive As Integer     = 12

	' Allows others to open a connection with any permissions.
	Public Const adModeShareDenyNone As Integer      = 16

	' Used with adModeShareDenyNone, adModeShareDenyWrite, or adModeShareDenyRead to set permissions on all sub-records of the current Record.
	Public Const adModeRecursive As Integer          = 4194304
	Public Const Null As Object                      = Nothing
	#End Region

	#Region "Delegates"
Delegate Function GetRefDelegate(<[ParamArray]()> list() As Object)
	#End Region


<Obsolete("VB6 IsNull is obsoleted")>
Shared Function IsNull(v)
If (TypeOf v Is String) Then
	        Return String.IsNullOrEmpty(v)
	    End If
		If (TypeOf v Is System.DBNull) Then
			Return True
		End If
	    Return (v Is Nothing)
End Function 

<Obsolete("VB6 IsObject is obsoleted")>
Shared Function IsObject(v)
If (v Is Nothing) Then
				Return False
			End If
			If (v.GetType().IsPrimitive) Then
				Return False
			End If
			If (TypeOf v Is Object) Then
				Return True
			End If
			Return False
End Function 

<Obsolete("VB6 IsEmpty is obsoleted")>
Shared Function IsEmpty(v)
Return String.IsNullOrEmpty(v)
End Function 

<Obsolete("VB6 Consider using Native .NET Classes for a performance increase")>
Shared Function CreateObject(v)
Return System.Activator.CreateInstance(System.Type.GetTypeFromProgID( v ))
End Function 

<Obsolete("VB6 CCur is obsoleted")>
Shared Function CCur(v)
Return v.ToString("c2")
End Function 

<Obsolete("VB6 Eval is Evil!")>
Shared Function Eval(v)
Return ""
End Function 

<Obsolete("VB6 Execute is Evil!")>
Shared Function Execute(v)
Return ""
End Function 

<Obsolete("VB6 Timer is obsoleted")>
Shared Function Timer()
Return  Microsoft.VisualBasic.DateAndTime.Timer
End Function 

<Obsolete("VB6 Escape is obsoleted")>
Shared Function Escape(str)
Return str
End Function 

<Obsolete("VB6 UnEscape is obsoleted")>
Shared Function UnEscape(str)
Return str
End Function 

<Obsolete("VB6 GetRef is Evil!")>
Shared Function GetRef(methodName) As GetRefDelegate
'This is VBScript style reflection, it's supposed to return an executable delegate of method with specified name
		Return Nothing
End Function 


	'************************************************
	'
	' Sub: New
	' Sub is called when the class is instantiated 
	'
	'************************************************
	Sub New( Page As AspPage )

		MyBase.New( Page )


	End Sub

	Protected Overrides Sub Finalize()
	End Sub

End Class

' Wrapper for RegExp
Public Class RegExp
	Public Property Pattern As String
	Public Property IgnoreCase As Boolean
	Public Property GlobalMatch As Boolean

	Public Function Execute(SourceString As String)
		Return System.Text.RegularExpressions.Regex.Match(SourceString, Pattern)
	End Function

	Public Function Test(SourceString As String)
		Return System.Text.RegularExpressions.Regex.IsMatch(SourceString, Pattern)
	End Function

	Public Function Replace(SourceString As String, ReplaceString As String)
		Return System.Text.RegularExpressions.Regex.Replace(SourceString, Pattern, ReplaceString)
	End Function

	<Obsolete("VB6 RegExp is obsoleted, use the .NET System.Text.RegularExpressions.Regex instead.")>
	Sub New()
	End Sub
End Class
