473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

uint32 conversion on win32_pingstatus


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
Jan 11 '06 #1
1 2233
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

Jan 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: john smith | last post by:
I have never really understood the difference between the two notations below. I often run into code where they are passing in the address of some location. Some people do something like...
9
by: Xiangliang Meng | last post by:
Hi, all. I see a very strange fragment code today. Uint32 enum { a = 100; b = 200; }; NOTE: Uint32 is defined to be 'unsigned' in other source files.
1
by: Michel Racicot | last post by:
Hi there, The following code is troubling me: UInt32 nOffset = nStringEntriesOffset + (40 * nIndex); nStringEntriesOffset is a UInt32 containing 2124 nIndex is a UInt32 containing 5213 ...
2
by: Shankar | last post by:
Hi, I am writing a Managed C++ class library where interfaces take a unsigned int parameter. Looking at the CTS documentation, it is mentioned that there is no built- in type in VB.NET for this...
1
by: steellock | last post by:
The below code always get compile error, "Can not change Interger to UInt32". Then How to set the BackColor property With TextObjec .Name = "txtProductCode .SetText("Apple" .BackColor = 8 '...
2
by: steellock | last post by:
The below code always get compile error, "Can not change Integer to UInt32". Then how can I set BackColor property With txtob .Name = "txtProductCode .SetText("Apple" .BackColor = 8 '...
9
by: Chris Botha | last post by:
Hi, I have an UInt32 and want to stick the value into an Integer and get an Overflow exception, BUT using C# the same value can be casted into an int and the value is as expected. The Hex value is...
2
by: Bern McCarty | last post by:
In the old MEC++ syntax I can do this: // compile in VS 2005 shell with cl -clr:oldsyntax -LD ArrayCopyOldSyntax.cpp #using <mscorlib.dll> public __gc class CopyTest { private:...
11
by: Yaniv | last post by:
Hi How can I convert Uint32 variable to System.drawing.color ?? Thanks in advanced Yaniv
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.