Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Public Class Form1
- 'Version de windows complète
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- TextBox1.Text = "Version du système d'exploitation : " & Environment.OSVersion.ToString()
- End Sub
- 'Version de windows 32 ou 64 bits
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim rt As String = ""
- If Environment.Is64BitOperatingSystem = True Then
- rt = "Vous avez un Windows 64 bits"
- Else
- rt = "Vous avez un Windows 32 bits"
- End If
- Textbox2.text = rt
- End Sub
- 'Version de windws simplifiée
- Private Function GetBitVersion() As String
- Return IIf(Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Hardware\Description\System\CentralProcessor\0").GetValue("Identifier").ToString().Contains("x86"), "32 bit", "64 bit")
- End Function
- Private Function GetWindowsVersion() As String
- If Environment.OSVersion.Platform = PlatformID.Win32Windows Then
- Return IIf(Environment.OSVersion.Version.Minor = 10, "Windows 98", "Windows ME")
- Else
- Select Case Environment.OSVersion.Version.Major
- Case 4
- Return "Windows NT 4.0"
- Case 5
- Select Case Environment.OSVersion.Version.Minor
- Case 0
- Return "Windows 2000"
- Case 1
- Return "Windows XP"
- Case 2
- Return "Windows Server 2003"
- End Select
- Exit Select
- Case 6
- Return IIf(Environment.OSVersion.Version.Minor = 0, "Windows Vista", "Windows 7")
- End Select
- End If
- Return "Système d'exploitation inconnu"
- End Function
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- textbox3.text = GetWindowsVersion()
- End Sub
- 'Nombre de bits
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- TextBox4.Text = GetBitVersion()
- End Sub
- End Class
Add Comment
Please, Sign In to add comment