What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » VB and Network cards' IP

VB and Network cards' IP
Author: Message:
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. Sad  VB and Network cards' IP
I work with Visual Basic 2005 Express Edition, and I've been wondering, is there is a way to return the Network Card's IP address? Example:

TextBox1.Text = ([line of code for net card's IP])

So that it shows my card's IP: 192.168.1.8

And also can you find out the strength of a wireless signal (I have a Netgear WG311T) using VB, or do you need some sort of external .exe?

I don't know a whole heap on Visual Basic, so maybe I missed something.:S

Any help is much appreciated:)

This post was edited on 02-04-2007 at 05:45 AM by ryxdp.
02-04-2007 05:23 AM
Profile PM Find Quote Report
davidpolitis
Full Member
***


Posts: 371
Reputation: 16
Joined: Aug 2006
RE: VB and Network cards' IP
Steps:

1. Create a new project with the startup form name "Form1"

2. Add a Textbox name "Textbox1"

3. Replace all of the code with the below code.

-----------------------------------------------------------------------------------------------------

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName).AddressList(0).ToString()
    End Sub
End Class

-----------------------------------------------------------------------------------------------------



Hope this helped :P

This post was edited on 02-04-2007 at 10:10 AM by davidpolitis.
02-04-2007 08:48 AM
Profile PM Find Quote Report
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. RE: VB and Network cards' IP
Thanks, it worked :P
02-04-2007 10:35 AM
Profile PM Find Quote Report
davidpolitis
Full Member
***


Posts: 371
Reputation: 16
Joined: Aug 2006
RE: VB and Network cards' IP
Cool. Took me ages to find that, but I wanted to know how to do it anyway :P

Also, I'm sorry to say this but... the thing that you want to do with the wireless connection is basicaly impossible unless you get some SUPER coder to code it for you :'(

This post was edited on 02-04-2007 at 10:38 AM by davidpolitis.
02-04-2007 10:36 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: VB and Network cards' IP
quote:
Originally posted by Ryxpia
And also can you find out the strength of a wireless signal (I have a Netgear WG311T) using VB, or do you need some sort of external .exe?
It is very easy to do this using WMI and NDIS...

http://msdn2.microsoft.com/en-us/library/ms895622.aspx
http://msdn2.microsoft.com/en-us/library/ms901469.aspx

Also, google is your friend (as always), so search first (with the proper logic keywords):
http://www.google.be/search?q=VB+wifi+signal+strength

Example code can be found in many places, eg like:
http://www.planet-source-code.com/vb/scripts/Show...eId=2234&lngWId=10


------

PS: VB (both 6 and .NET) can do virtually anything any other exe can do, you don't need external exe's for anything, as long as you know how it is coded of course; a good example is (un)zipping which can be done perfectly within VB provided you know how ZIPs work and are (un)packed).

This post was edited on 02-04-2007 at 04:01 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
02-04-2007 03:59 PM
Profile PM Find Quote Report
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. RE: VB and Network cards' IP
Thanks(Y)

The Planet Source Code one works great, but I'd like to make the signal indicators the same sort of style as the network connections thing in the Control panel (see attachment).

As I said, I don't know a lot about VB, so thanks in advance :P

EDIT: I've nabbed the strength indicators from xpsp2res.dll in /system32/mui/0401 using ResHacker, how do I set them as the indicator, eg. something along the lines of:

vb.net code:
If dbl_strength = 0 Then
PictureBox1 = My.Resources.Signal_pic0
End If
 
If dbl_strength = 1 Then
PictureBox1 = My.Resources.Signal_pic1
End If

And so on...

(They are .icos, I will convert them to .pngs and hope PictureBoxes support .png transparency :S)

This post was edited on 12-22-2008 at 02:20 AM by ryxdp.
02-05-2007 05:53 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On