Click here to Skip to main content
Licence 
First Posted 22 Jun 2005
Views 33,328
Bookmarked 26 times

Operating System Information

By | 22 Jun 2005 | Article
An article on finding the OS name and OS language.

Sample Image

Introduction

This code finds OS information, i.e., it finds the name of the OS which is installed in your machine and the language of the OS.

Using the code

This code uses the WqlObjectQuery to find OS information. It uses the namespace System.Management. What is does is it basically finds the locale of the OS which is specific for a particular language of the OS. It actually queries the table win32_OperatingSystem which comes up with the operating system to find the OS name and the locale of the OS. This code runs on both 32 bit and 64 bit OS if there is .NET framework installed in the OS. For example, I make the code to find the locale of 8 different languages like English, German, French, Russian, Spanish, PortBraz, Polish and Italian. Any locale can be added to the code to find the OS Language.

Dim objectQuery As New WqlObjectQuery("select * from win32_OperatingSystem")
Dim searcher As New ManagementObjectSearcher(objectQuery)
Dim share As ManagementObject
Dim a As String
Dim os As String
For Each share In searcher.Get()
    a = share("Name")
    Dim split1 As String()
    split1 = Split(a, "|")
    os = split1(0)
    TextBox2.Text = os
    Button2.Text = os
Next share

For Each share In searcher.Get()

    a = share("Locale")
    If a = "0409" Then
        TextBox1.Text = "English"
        Button1.Text = "English"
    ElseIf a = "0407" Then
        TextBox1.Text = "German"
        Button1.Text = "German"
    ElseIf a = "040a" Then
        TextBox1.Text = "Spanish"
        Button1.Text = "Spanish"
    ElseIf a = "040c" Then

Points of Interest

This code is useful for GUI translation. Using this code one can translate the GUI to any specific language.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

cs_debraj@rediffmail.com

Web Developer

United States United States

Member

I am a Computer Engineer and in the Software
Industry for 1 year.Working on VC++,and Client Server architecture.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalpushpa Pinmemberpushpaabhi22:25 11 Jun '08  
QuestionDetect Licence Language version of OS? Pinmemberboshesh5:15 13 Jul '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 23 Jun 2005
Article Copyright 2005 by cs_debraj@rediffmail.com
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid