Results 1 to 11 of 11

Thread: Yet another way to check the OS name.

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Yet another way to check the OS name.

    The application that I'm working on needs to work different OS's.
    For example the glass effect that I have posted inside
    This is a very simple, and easy way to check the OS name.
    If Microsoft did not have 6 different version of each major release.
    Then this would have not been necessary.
    vb.net Code:
    1. Dim Full_Os_Name As String = My.Computer.Info.OSFullName
    2.     Dim User_Os As String
    3.     Sub Get_OS_NAME()
    4.         If Full_Os_Name.Contains("Windows 7") Then
    5.             User_Os = "Windows 7"
    6.         ElseIf Full_Os_Name.Contains("Windows Vista")Then
    7.             User_Os = "Windows Vista"
    8.         ElseIf Full_Os_Name.Contains("Windows XP")Then
    9.             User_Os = "Windows XP"
    10.         Else
    11.             MessageBox.Show(Full_Os_Name & " is not supported by: " & My.Application.Info.ProductName & ", Version " & My.Application.Info.Version.ToString)
    12.             Application.Exit()
    13.         End If
    14.     End Sub
    15.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    16.         Get_OS_Name()
    17.     End Sub
    Now you only have to compare "Windows 7", for example without comparing Windows Stater, Ultimate, Professional, Super Ultimate, Ultimate X2, and, Ultimate V5. You get the point.
    If you like it, please vote my rep is struggling.
    Last edited by Pc_Not_Mac; Jun 12th, 2011 at 02:26 PM. Reason: Removed some bugs. Thanks minitech.
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width