Advertisement
kshadow22

Check Operating System Visual Basic

Jun 29th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Check Operating System (OS)
  2.  
  3. Dim Full_Os_Name As String = My.Computer.Info.OSFullName
  4.     Dim User_Os As String
  5.     Sub Get_OS_NAME()
  6.         If Full_Os_Name.Contains("Windows 7") Then
  7.             User_Os = "Windows 7"
  8.         ElseIf Full_Os_Name.Contains("Windows Vista")Then
  9.             User_Os = "Windows Vista"
  10.         ElseIf Full_Os_Name.Contains("Windows XP")Then
  11.             User_Os = "Windows XP"
  12.         Else
  13.             MessageBox.Show(Full_Os_Name & " is not supported by: " & My.Application.Info.ProductName & ", Version " & My.Application.Info.Version.ToString)
  14.             Application.Exit()
  15.         End If
  16.  'Label3.Text = ("OS: " & User_Os)
  17.    End Sub
  18.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  19.         Get_OS_Name()
  20.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement