objsh = CreateObject("WScript.Shell") strObject = "C:\Temp\ASERVICE.EDM" Dim process = GetObject("winmgmts://./root/novadigm:NVD_Agent") Dim method = process.Methods_("GetValue") Dim inParameters = method.inParameters.SpawnInstance_() inParameters.Path = strObject Dim outParameters = process.ExecMethod_("NumberOfInstances", inParameters) Dim StrHeaps = (outParameters.InstanceCount) num_TextBox.Text = StrHeaps For i = 0 To StrHeaps Step +1 inParameters.Index = i inParameters.Property = "ZOBJNAME" outParameters = process.ExecMethod_("GetValue", inParameters) Dim Value1 As String = outParameters.Value inParameters.Property = "ZAVIS" outParameters = process.ExecMethod_("GetValue", inParameters) Dim Value2 As String = outParameters.Value inParameters.Property = "NAME" outParameters = process.ExecMethod_("GetValue", inParameters) Dim Value3 As String = outParameters.Value inParameters.Property = "INSTDATE" outParameters = process.ExecMethod_("GetValue", inParameters) Dim value5 As String = outParameters.Value Dim value4 = ListView1.Items.Count Dim item As New ListViewItem(value4) item.SubItems.Add(Value1) item.SubItems.Add(Value2) item.SubItems.Add(Value3) item.SubItems.Add(value5) ListView1.Items.Add(item) ListView1.FullRowSelect = True For Each item1 As ListViewItem In ListView1.Items If item1.Index Mod 2 = 0 Then item1.BackColor = Color.LightBlue Else item1.BackColor = Color.LightGray End If Next Next End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)