Ford-p
Active member
- Joined
- Mar 1, 2007
- Messages
- 30
- Programming Experience
- Beginner
Hey,
I'm trying to find the Windows version of the PC my program is run on. So far I have found this:
This works fine apart from the fact Vista isn't supported. Also it would be nice to show the edtion (Home/Pro in XP, Home/Ent/Ultimate in Vista).
Anyone have any ideas?
Thanks,
Joe
I'm trying to find the Windows version of the PC my program is run on. So far I have found this:
VB.NET:
Public Function OSVersion() As String
Dim objVer As OperatingSystem
Dim strVer As String = ""
objVer = System.Environment.OSVersion
With objVer
Select Case .Platform
Case .Platform.Win32Windows
Select Case (.Version.Minor)
Case 0
strVer = "Microsoft Windows 95"
Case 10
If .Version.Revision.ToString() = "2222A" Then
strVer = "Microsoft Windows 98 Second Edition"
Else
strVer = "Microsoft Windows 98"
End If
Case 90
strVer = "Microsoft Windows ME"
End Select
Case .Platform.Win32NT
Select Case (.Version.Major)
Case 3
strVer = "Microsoft Windows NT 3.51"
Case 4
strVer = "Microsoft Windows NT 4.0"
Case 5
If .Version.Minor = 0 Then
strVer = "Microsoft Windows 2000"
ElseIf .Version.Minor = 1 Then
strVer = "Microsoft Windows XP"
ElseIf .Version.Minor = 2 Then
strVer = "Microsoft Windows Server 2003"
Else 'Future version maybe update
'as needed
strVer = "Unknown Windows Version"
End If
End Select
End Select
End With
Return strVer
End Function
Anyone have any ideas?
Thanks,
Joe