Hi,
Try this.
Dim intResult As Integer = Integer.Parse(result("statuscode").ToString)
If intResult = 0 Then
Ken
--------------------------
"James" <jk****@hotmail.com> wrote in message
news:uV**************@TK2MSFTNGP11.phx.gbl...
Dim str As String = "select * from win32_pingstatus where address=
'192.168.0.1'"
Dim search1 As New ManagementObjectSearcher(str)
Dim result As ManagementObject
Try
For Each result In search1.Get
If result("statuscode") = 0 Then
Console.WriteLine("computer response")
Else
Console.WriteLine("invalid computer")
End If
Next
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
i keep on getting exception error : Cast from type 'UInt32' to type
'Integer' is not valid. Pls advise