How to find out if OS is Windows XP?

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

Hi,

I want to know i my application is running under Windows XP.
I can retrieve the platform and version from the OSVersion object. The
problem is that i can't map these into an operating system. I can't find it
on MSDN or Microsoft's homepage.

Fred
 
Hi,
I have code taken form other site.....................

Public Function GetVersion() As String
Dim os_version As OperatingSystem = Environment.OSVersion
With os_version
Select Case .Platform
Case .Platform.Win32Windows
' Win32.
Select Case (.Version.Minor)
Case 0
Return "Windows 95"
Case 10
If .Version.Revision.ToString() = _
"2222A" Then
Return "Windows 98 Second " & _
"Edition"
Else
Return "Windows 98"
End If
Case 90
Return "Windows Me"
End Select
Case .Platform.Win32NT
' WinNT.
Select Case (.Version.Major)
Case 3
Return "Windows NT 3.51"
Case 4
Return "Windows NT 4.0"
Case 5
Select Case (.Version.Minor)
Case 0
Return "Windows 2000"
Case 1
Return "Windows XP"
Case 2
Return "Windows Server 2003"
End Select
Case Else
Return "Unknown"
End Select
Case Else
Return "Unknown"
End Select
End With
End Function


I hope this will help u..............

Regards,
Ritesh
 
Back
Top