List Network in Window Xp

menglim

Member
Joined
Oct 5, 2009
Messages
9
Programming Experience
Beginner
Hi ! I am just new developer. I want to know more about VB.NET.


Can you tell me the code how to list network adopter in PC using VB.NET?

I am a student at RUPP in major IT.
 
I can not find.
Were you really tired and unable to type more than those four words? You couldn't find what exactly? How exactly did you try to find what it was that you couldn't? If you're talking about the NetworkInterface class then there's nothing to find; you just click on the link provided by JohnH.
 
When I declare a variable ni as NetworkInterface.
I just want to see what it display.

VB.NET:
MessageBox.show(ni.Description)
MessageBox.show(ni.IP)

I doesn't work.
It displays an error.

Object reference not set to an instance of an object.

When I use it with new keyword, there is no NetworkInterface.

Please help me
 
JohnH provided you with a link to the documentation for the NetworkInterface class which you obviously haven't bothered to read. Had you done so it would have taken about 30 seconds to find this:
This class encapsulates data for network interfaces, also known as adapters, on the local computer. You do not create instances of this class; the GetAllNetworkInterfaces method returns an array that contains one instance of this class for each network interface on the local computer.
I suggest that you do what you should have done in the first place and follow the link that JohnH provided and read it top to bottom. Of particular interest will be the quote that I posted above and the subsequent code example. It's only provided in C# and C++ but you should be able to get the idea from the C# code, plus there are various online code converters that will give you the equivalent VB code.
 
Please give the link. I can not find any examples. Thank you

The link has already been given twice, in posts #3 and #4. Now JB has given it a third time. Please make sure you actually follow it and read it this time.
 
Back
Top