Vlachs Posted February 20, 2013 Report Posted February 20, 2013 Imports System.ManagementPublic Class Resources Public Shared Function WMI(ByVal location As String, ByVal query_term As String, ByVal value As String) As String Dim Result = String.Empty Try Dim WmiSelect As New ManagementObjectSearcher(location, query_term) For Each WmiResults As ManagementObject In WmiSelect.Get() Result = WmiResults.GetPropertyValue(value).ToString If (Not String.IsNullOrEmpty(Result)) Then Exit For End If Next Catch err As ManagementException MessageBox.Show(err.Message) End Try Return Result End FunctionEnd ClassExemplu: Label1.Text = "Video Card: " & Resources.WMI("root\CIMV2", "SELECT * FROM Win32_VideoController", "Name") Label2.Text = "Processor: " & Resources.WMI("root\CIMV2", "SELECT * FROM Win32_Processor", "Name")Trebuie sa adaugati System.Management ca referinta inainte de a putea accesa datele. 1 Quote
Maximus Posted February 24, 2013 Report Posted February 24, 2013 am incercat sa o fac pt vb6, dar fara succes, ai ceva asemanator pentru vb6 ? Quote
Vlachs Posted February 25, 2013 Author Report Posted February 25, 2013 am incercat sa o fac pt vb6, dar fara succes, ai ceva asemanator pentru vb6 ?Nup, nu am mai scris in vb6 de secole:)) Quote