hi, im making a program that uses the IP address of the computer its on, but
i dont kno how to programmaticly find it.....can anyone point me in the rite
direction? thanks
--
-iwdu15 10 1394
Imports System.Net
Dim HostIP As IPAddress
HostIP = Dns.GetHostByName(Dns.GetHostName).AddressList.Get Value(0)
Rgds, Phil
"iwdu15" <iw****@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com... hi, im making a program that uses the IP address of the computer its on, but i dont kno how to programmaticly find it.....can anyone point me in the rite direction? thanks -- -iwdu15
and if the computer is behind a router, is there a way to know the
public(Internet) IP?
thanks
"Phil G." <Ph**@nospam.com> a écrit dans le message de
news:de**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com... Imports System.Net
Dim HostIP As IPAddress HostIP = Dns.GetHostByName(Dns.GetHostName).AddressList.Get Value(0)
Rgds, Phil
"iwdu15" <iw****@discussions.microsoft.com> wrote in message news:B6**********************************@microsof t.com... hi, im making a program that uses the IP address of the computer its on, but i dont kno how to programmaticly find it.....can anyone point me in the rite direction? thanks -- -iwdu15
Hi, http://www.windowsformsdatagridhelp....f-a311e93c13c3
Ken
-----------------------
"ThunderMusic" <NO*******@sympatico.caSPAMATALL> wrote in message
news:e4**************@TK2MSFTNGP15.phx.gbl...
and if the computer is behind a router, is there a way to know the
public(Internet) IP?
thanks
"Phil G." <Ph**@nospam.com> a écrit dans le message de
news:de**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com... Imports System.Net
Dim HostIP As IPAddress HostIP = Dns.GetHostByName(Dns.GetHostName).AddressList.Get Value(0)
Rgds, Phil
"iwdu15" <iw****@discussions.microsoft.com> wrote in message news:B6**********************************@microsof t.com... hi, im making a program that uses the IP address of the computer its on, but i dont kno how to programmaticly find it.....can anyone point me in the rite direction? thanks -- -iwdu15
Here is the same but in c#
using System.Net;
//
IPHostEntry o = Dns.GetHostByName( Dns.GetHostName() );
MessageBox.Show("Your IP address is : " +o.AddressList[0] );
good luck !
craig kelly-soens - Windows Vista WinFx XAML .Net Evangelist http://www.XpectWorld.com - customised "super-easy to use" Windows Vista
based software & consultancy
Is there a way to programatically get the router IP address, if the LAN is on
a router?
--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
"Ken Tucker [MVP]" wrote:
Hi,
http://www.windowsformsdatagridhelp....f-a311e93c13c3
Ken
-----------------------
"ThunderMusic" <NO*******@sympatico.caSPAMATALLwrote in message
news:e4**************@TK2MSFTNGP15.phx.gbl...
and if the computer is behind a router, is there a way to know the
public(Internet) IP?
thanks
"Phil G." <Ph**@nospam.coma écrit dans le message de
news:de**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Imports System.Net
Dim HostIP As IPAddress
HostIP = Dns.GetHostByName(Dns.GetHostName).AddressList.Get Value(0)
Rgds, Phil
"iwdu15" <iw****@discussions.microsoft.comwrote in message
news:B6**********************************@microsof t.com...
hi, im making a program that uses the IP address of the computer its on,
but
i dont kno how to programmaticly find it.....can anyone point me in the
rite
direction? thanks
--
-iwdu15
You could get it from WMI.
WIN32_NetworkAdapterConfiguration.DefaultIpGateway
"eSolTec, Inc. 501(c)(3)" <es*****@noemail.nospamwrote in message
news:9A**********************************@microsof t.com...
Is there a way to programatically get the router IP address, if the LAN is
on
a router?
--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
"Ken Tucker [MVP]" wrote:
>Hi,
http://www.windowsformsdatagridhelp....f-a311e93c13c3
Ken ----------------------- "ThunderMusic" <NO*******@sympatico.caSPAMATALLwrote in message news:e4**************@TK2MSFTNGP15.phx.gbl... and if the computer is behind a router, is there a way to know the public(Internet) IP?
thanks
"Phil G." <Ph**@nospam.coma écrit dans le message de news:de**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Imports System.Net
Dim HostIP As IPAddress
HostIP = Dns.GetHostByName(Dns.GetHostName).AddressList.Get Value(0)
Rgds, Phil
"iwdu15" <iw****@discussions.microsoft.comwrote in message
news:B6**********************************@microsof t.com...
hi, im making a program that uses the IP address of the computer its
on,
but
i dont kno how to programmaticly find it.....can anyone point me in
the
rite
direction? thanks
--
-iwdu15
Hi
I agree Terry's suggestion, here I provide the code snippet for your
reference.
'NOTE: You need add reference to System.Management.dll first.
Dim mc As System.Management.ManagementClass
Dim mo As ManagementObject
mc = New ManagementClass("Win32_NetworkAdapterConfiguration ")
Dim moc As ManagementObjectCollection = mc.GetInstances()
For Each mo In moc
If mo.Item("IPEnabled") = True Then
Debug.WriteLine("Network Adapter MAC address " &
mo.Item("MacAddress").ToString())
Debug.WriteLine("Gateway(Rounter): ")
Dim ss() As String = mo.Item("DefaultIpGateway")
For Each s As String In ss
Debug.WriteLine(" " + s)
Next
End If
Next
You may have a try, and if you have other concern, please feel free to let
me know.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Peter,
Thank you for your code snippet. It is greatly appreciated. Now I'm
wondering how to get the information from the Immediate window into a label
container :) please
--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
""Peter Huang" [MSFT]" wrote:
Hi
I agree Terry's suggestion, here I provide the code snippet for your
reference.
'NOTE: You need add reference to System.Management.dll first.
Dim mc As System.Management.ManagementClass
Dim mo As ManagementObject
mc = New ManagementClass("Win32_NetworkAdapterConfiguration ")
Dim moc As ManagementObjectCollection = mc.GetInstances()
For Each mo In moc
If mo.Item("IPEnabled") = True Then
Debug.WriteLine("Network Adapter MAC address " &
mo.Item("MacAddress").ToString())
Debug.WriteLine("Gateway(Rounter): ")
Dim ss() As String = mo.Item("DefaultIpGateway")
For Each s As String In ss
Debug.WriteLine(" " + s)
Next
End If
Next
You may have a try, and if you have other concern, please feel free to let
me know.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi Michael,
For the other Debug.Print, it is simple.
Change the Debug.WriteLine to LabelX.Text =
For the code below.
For Each s As String In ss
Debug.WriteLine(" " + s)
Next
We need to decided how many labels or which element we want in the ss
string array.
e.g.
If ss.Length 1 Then
Label1.Text = ss(0)
End If
You may have a try and let me know the result. :)
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Picture Dots |
last post by:
Ok - I want to check a string for @ in it (Im checking to see if a string
that should contain an email holds a @ )
How would I go about this? preg_match? ereg? strstr?Examples?
Also - how...
|
by: Antitax |
last post by:
I have a database with more than 800 adress records
Some of the are similar because some letters in the street adress for
example are not identical, altough they point to the same adress.
Does...
|
by: Lauren Wilson |
last post by:
Hi Folks,
We've been using Crypto ++32 to control licensed access to our widely
distributed Access 2K app. Unfortunately, Sampson Multimedia appears
to be out of business.
Does anyone out...
|
by: FR3AK |
last post by:
Hi.
does anyone have any idea of how to find the mac address of a remote
networking device? I've worked with WMI and it works fine as long as the
target machine is a Windows computer, however,...
|
by: |
last post by:
Hello,
I'm keping myself busy here by investigating the world of LDAP and Active
Directory. I have an application which allows users from the system to be
selected from a list box and as a...
|
by: Lad |
last post by:
Did anyone try to find out a regular expression for finding an email
address in a text?
Thank you for the reply
L.
|
by: axlq |
last post by:
Does anyone have a favored way of finding the geographic location
of a user's IP address, so that a php script can include content
relevant to that location?
Reverse-lookup of the hostname isn't...
|
by: abhimanyu.v |
last post by:
Hi Guys,
I have one doubt. The test program is given below. It uses two way of
finding out the offset of a variable in structure. I executed the
program and found the same result.
My question...
|
by: Timothy Grant |
last post by:
On Tue, Aug 5, 2008 at 2:50 PM, David York <davideyork@gmail.comwrote:
I'm not sure what you are trying to accomplish. The machine I'm typing
this on has a 192.168.x.x number. The router that...
|
by: Astley Le Jasper |
last post by:
Sorry for the numpty question ...
How do you find the reference name of an object?
So if i have this
bob = modulename.objectname()
how do i find that the name is 'bob'
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |