Ermittelt das verwendete Betriebssystem im Klartext
Public Class clsOperatingSystemInfo
Public Function OSMainInformation() As String
Dim majorVersion As Integer = Environment.OSVersion.Version.Major
Dim minorVersion As Integer = Environment.OSVersion.Version.Minor
Dim Plattform As String = String.Empty
Select Case Environment.OSVersion.Platform
Case PlatformID.Win32Windows
If minorVersion = 90 Then ' Windows Me
Plattform = "Windows ME"
Else
Plattform = ""
End If
Case PlatformID.Win32NT
Select Case majorVersion
Case 5
If minorVersion = 0 Then ' Windows 2000
Plattform = "Windows 2000"
ElseIf minorVersion = 1 Then ' Windows XP
Plattform = "Windows XP"
ElseIf minorVersion = 2 Then ' Windows Server 2003
Plattform = "Windows Server 2003"
Else
Plattform = ""
End If
Case 6
If minorVersion = 0 Then ' Windows Vista
Plattform = "Windows Vista"
ElseIf minorVersion = 1 Then ' Windows Server 2008 (?)
Plattform = "Windows Server XXXX. Possible Name: 2008 (?)"
Else
Plattform = ""
End If
Case Else
Plattform = "unkmnown"
End Select
End Select
Return Plattform
End Function
Kommentare zum Snippet