Posted By

goo on 10/03/10


Tagged

name Net PC


Versions (?)

Programmatically Determine the Operating System using .NET


 / Published in: VB.NET
 

URL: http://www.devcurry.com/2010/10/programmatically-determine-operating.html

  1. Imports System
  2. Imports System.Management
  3.  
  4. Namespace ConsoleApplication1
  5. Friend Class Program
  6. Public Shared Sub Main()
  7. Dim winos As String = "Select Name from Win32_OperatingSystem"
  8. Dim mos As New ManagementObjectSearcher(winos)
  9. For Each mo As ManagementObject In mos.Get()
  10. Console.WriteLine("OS Name: {0}", mo("Name"))
  11. Next mo
  12. Console.ReadLine()
  13. End Sub
  14. End Class
  15. End Namespace

Report this snippet  

You need to login to post a comment.