Hi,
I am converting existing vb.net application to Visual Studio 2005, I got multiple warnings, Here is one. Please let me know how to fix this. Thanks in advance.
Public Function fCheckBrowser( _
ByVal Request As System.Web.HttpRequest, _
ByVal BrowserName As String, _
ByVal BrowserVersion As String) As Boolean
' rewrite to set Properties instead of building a String thing
' Dim x As String
Dim s As String = ""
With Request.Browser
s &= "Browser Capabilities" & vbCrLf
s &= "Type = " & .Type & vbCrLf
s &= "Name = " & .Browser & vbCrLf
s &= "Version = " & .Version & vbCrLf
s &= "Major Version = " & .MajorVersion & vbCrLf
s &= "Minor Version = " & .MinorVersion & vbCrLf
s &= "Platform = " & .Platform & vbCrLf
s &= "Is Beta = " & .Beta & vbCrLf
s &= "Is Crawler = " & .Crawler & vbCrLf
s &= "Is AOL = " & .AOL & vbCrLf
s &= "Is Win16 = " & .Win16 & vbCrLf
s &= "Is Win32 = " & .Win32 & vbCrLf
s &= "Supports Frames = " & .Frames & vbCrLf
s &= "Supports Tables = " & .Tables & vbCrLf
s &= "Supports Cookies = " & .Cookies & vbCrLf
s &= "Supports VBScript = " & .VBScript & vbCrLf
s &= "Supports JavaScript = " & .JavaScript & vbCrLf
s &= "Supports Java Applets = " & .JavaApplets & vbCrLf
s &= "Supports ActiveX Controls = " & .ActiveXControls & vbCrLf
End With
Dim strBrowserName As String
Dim strBrowserVersion As String
Dim blnResult As Boolean
strBrowserName = UCase$(Trim$(BrowserName))
strBrowserVersion = Trim$(Replace(BrowserVersion, ".", String.Empty, , , CompareMethod.Binary))
Select Case False
Case strBrowserName = UCase$(Request.Browser.Browser)
Case strBrowserVersion < Trim$(Replace(Request.Browser.Version, ".", String.Empty, , , CompareMethod.Binary))
Case Else
blnResult = True
End Select
Return blnResult
End Function ' fCheckBrowser
The warning is on the bolded line, and it is "Public ReadOnly Property JavaScript() as boolean is obsolete, the recommended version is the EcmaScriptVersion.
Thanks,
I am converting existing vb.net application to Visual Studio 2005, I got multiple warnings, Here is one. Please let me know how to fix this. Thanks in advance.
Public Function fCheckBrowser( _
ByVal Request As System.Web.HttpRequest, _
ByVal BrowserName As String, _
ByVal BrowserVersion As String) As Boolean
' rewrite to set Properties instead of building a String thing
' Dim x As String
Dim s As String = ""
With Request.Browser
s &= "Browser Capabilities" & vbCrLf
s &= "Type = " & .Type & vbCrLf
s &= "Name = " & .Browser & vbCrLf
s &= "Version = " & .Version & vbCrLf
s &= "Major Version = " & .MajorVersion & vbCrLf
s &= "Minor Version = " & .MinorVersion & vbCrLf
s &= "Platform = " & .Platform & vbCrLf
s &= "Is Beta = " & .Beta & vbCrLf
s &= "Is Crawler = " & .Crawler & vbCrLf
s &= "Is AOL = " & .AOL & vbCrLf
s &= "Is Win16 = " & .Win16 & vbCrLf
s &= "Is Win32 = " & .Win32 & vbCrLf
s &= "Supports Frames = " & .Frames & vbCrLf
s &= "Supports Tables = " & .Tables & vbCrLf
s &= "Supports Cookies = " & .Cookies & vbCrLf
s &= "Supports VBScript = " & .VBScript & vbCrLf
s &= "Supports JavaScript = " & .JavaScript & vbCrLf
s &= "Supports Java Applets = " & .JavaApplets & vbCrLf
s &= "Supports ActiveX Controls = " & .ActiveXControls & vbCrLf
End With
Dim strBrowserName As String
Dim strBrowserVersion As String
Dim blnResult As Boolean
strBrowserName = UCase$(Trim$(BrowserName))
strBrowserVersion = Trim$(Replace(BrowserVersion, ".", String.Empty, , , CompareMethod.Binary))
Select Case False
Case strBrowserName = UCase$(Request.Browser.Browser)
Case strBrowserVersion < Trim$(Replace(Request.Browser.Version, ".", String.Empty, , , CompareMethod.Binary))
Case Else
blnResult = True
End Select
Return blnResult
End Function ' fCheckBrowser
The warning is on the bolded line, and it is "Public ReadOnly Property JavaScript() as boolean is obsolete, the recommended version is the EcmaScriptVersion.
Thanks,