Imports System
Imports System.Management
Imports System.Windows.Forms
Namespace WMISample
Public Class MyWMIQuery
Public Overloads Shared Function Main() As Integer
Try
Dim arrComputers As String() = _
{"Sistemas"}
For Each strComputer As String In arrComputers
Console.WriteLine("==========================================")
Console.WriteLine("Computer: " & strComputer)
Console.WriteLine("==========================================")
Dim searcher As New ManagementObjectSearcher( _
"\\" + strComputer + "\root\CIMV2", _
"SELECT * FROM Win32_OperatingSystem")
For Each queryObj As ManagementObject In searcher.Get()
Console.WriteLine("-----------------------------------")
Console.WriteLine("Win32_OperatingSystem instance")
Console.WriteLine("-----------------------------------")
Console.WriteLine("Caption: {0}", queryObj("Caption"))
Console.WriteLine("Version: {0}", queryObj("Version"))
Next
Next
Catch err As ManagementException
MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
End Try
End Function
End Class
End Namespace
sábado, 17 de diciembre de 2011
Información del Sistema - Ver que sistema operativo tiene mi PC VB.NET
Home »
Programadores
,
vb2010
,
Visual Basic .Net
»
Información del Sistema - Ver que sistema operativo tiene mi PC VB.NET
Ver que sistema operativo tiene mi PC VB.NET
No hay comentarios:
Publicar un comentario