objsh = CreateObject("WScript.Shell") Dim strObject As String = "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) Cae1.CAE_Heap_Count.Text = StrHeaps For i = 0 To StrHeaps Step 1 inParameters.Index = i inParameters.Property = "ZOBJNAME" outParameters = process.ExecMethod_("GetValue", inParameters) Dim Value2 As String = outParameters.Value inParameters.Property = "ZAVIS" outParameters = process.ExecMethod_("GetValue", inParameters) Dim Value3 As String = outParameters.Value inParameters.Property = "ZSVCCSTA" outParameters = process.ExecMethod_("GetValue", inParameters) Dim Value4 As String = outParameters.Value inParameters.Property = "NAME" outParameters = process.ExecMethod_("GetValue", inParameters) Dim Value5 As String = outParameters.Value inParameters.Property = "INSTDATE" outParameters = process.ExecMethod_("GetValue", inParameters) Dim value6 As String = outParameters.Value inParameters.Property = "ZVERIFY" outParameters = process.ExecMethod_("GetValue", inParameters) Dim value8 As String = outParameters.Value 'Date Dim str As String Dim strArr() As String Dim count As Integer Dim value7 As String str = value6 strArr = str.Split("T") For count = 0 To strArr.Length - 2 value7 = (strArr(count)) Next Dim value1 = Cae1.CAE_Listview.Items.Count Dim item As New ListViewItem(value1) item.SubItems.Add(Value2) item.SubItems.Add(Value3) item.SubItems.Add(Value4) If Value4 = "999" Then item.BackColor = Color.Gold End If If Value4 = "324" Then item.BackColor = Color.Gold End If If Value4 = "209" Then item.BackColor = Color.Red End If If Value4 = "709" Then item.BackColor = Color.Red End If If Value4 = "810" Then item.BackColor = Color.Red End If If Value4 = "811" Then item.BackColor = Color.Red End If item.SubItems.Add(Value5) item.SubItems.Add(value7) item.SubItems.Add(value8) Cae1.CAE_Listview.Items.Add(item) Cae1.CAE_Listview.FullRowSelect = True Next Cae1.CAE_Listview.Items(Cae1.CAE_Listview.Items.Count - 1).Remove()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)