Re: I want to get the wlan IP address for the PPC



Hi mcruz,

You should look at Smart Device Framework
www.opennetcf.com

**** my sample ****
AdapterCollection ac = Networking.GetAdapters();

foreach(Adapter a in ac)
{
this.listBox2.Items.Add("Name: " + a.Name);
this.listBox2.Items.Add("IP: " +a.CurrentIpAddress) ;
this.listBox2.Items.Add("Submask: " + a.CurrentSubnetMask);
this.listBox2.Items.Add("Desp: " + a.Description);
this.listBox2.Items.Add("Type: " + a.Type.ToString());
this.listBox2.Items.Add("Mac: " + a.MacAddress[0].ToString("x") +":" +
a.MacAddress[1].ToString("x") +":" + a.MacAddress[2].ToString("x") +":" +
a.MacAddress[3].ToString("x") +":" + a.MacAddress[4].ToString("x") +":" +
a.MacAddress[5].ToString("x") );
if(a.DhcpEnabled)
{
this.listBox2.Items.Add("DHCP: " + a.DhcpServer);
this.listBox2.Items.Add("LeaseEx: "+a.LeaseExpires.ToString());
this.listBox2.Items.Add("LeaseOb: "+a.LeaseObtained.ToString());
}

this.listBox2.Items.Add("Gateway: "+a.Gateway);
if (a.IsWireless)
{
this.listBox2.Items.Add("SigdB: "+ a.SignalStrengthInDecibels);

SignalStrength test = a.SignalStrength;

this.listBox2.Items.Add("SigdB: "+ test.Decibels);
this.listBox2.Items.Add("StrType: "+ test.Strength.ToString());
}
}

if your adapter is wireless, "a.wireless" is true which means you got your
wlan IP.

Sebastien Rousset

"Omar [MS]" wrote:

> You can use the IPHelper API's which are less friendly to use, but they'll
> allow you to get the MAC address and possibly a friendly name for the
> different adapters in your system.
>
> Thanks,
> - Omar
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Please do not send
> email directly to this alias. This alias is for newsgroup purposes only.
>
>
>
> "mcruz" <mcruz@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:4C87C754-EDCA-431D-8A96-C2F63A21513D@xxxxxxxxxxxxxxxx
> > this works. i get back 3 "IPaddresses". how can i tell which of these
> > are
> > assoicated with the WLAN?
> > --
> > Maria Cruz
> > MTC Technologies.com
> >
> >
> > "Omar [MS]" wrote:
> >
> >> instead of passing in "localhost" try passing in the string you get from
> >> gethostname.
> >>
> >>
> >> --
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >> Please do not send
> >> email directly to this alias. This alias is for newsgroup purposes only.
> >>
> >>
> >>
> >> "mcruz" <mcruz@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:2717D342-A43C-4B7C-8995-75EA3279348B@xxxxxxxxxxxxxxxx
> >> >I am using C#, is there a way to get the IP for the PPC associated with
> >> >the
> >> > WLAN? I tried
> >> >
> >> > // Get DNS host information.
> >> > IPHostEntry hostInfo = Dns.Resolve("localhost"); //VNETUSBA1
> >> > // Get the DNS IP addresses associated with the host.
> >> > IPAddress[] IPaddresses = hostInfo.AddressList;
> >> >
> >> > if (IPaddresses.Length > 0)
> >> > {
> >> > hostAddress = IPaddresses[0];
> >> > ipToUse = hostAddress.ToString();
> >> > }
> >> >
> >> > ---------------------
> >> > BUT all i get is "127.0.0.1". I am connected to an wireless access
> >> > point
> >> > using dhcp. I know the address is 192.168.8.X but i want to
> >> > programically
> >> > get it cause it could change.
> >> > thanks for any help
> >> > --
> >> > Maria Cruz
> >> > MTC Technologies.com
> >>
> >>
> >>
>
>
>
.



Relevant Pages

  • Re: Modifying a From address
    ... Corporate/Workgroup mode? ... Please do not send email directly to this alias. ... -This posting is provided "AS IS" with no warranties, and confers no rights ... >>newsgroup purposes only. ...
    (microsoft.public.outlook)
  • Re: Exchange 2003 and Relaying
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... Please do not send e-mail directly to this alias. ... >> Use of any included script samples are subject to the terms specified at ... >> newsgroup purposes only. ...
    (microsoft.public.exchange2000.admin)
  • Re: Internal connection fatal error
    ... > rights.Please do not send email directly to this alias. ... > This alias is for newsgroup purposes only. ... > rights. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Does Bill Gates know about the DDK regarding C++?
    ... > so wrap all usage of the STL object in SEH blocks and then only call it at ... > Please do not send e-mail directly to this alias. ... > This posting is provided "AS IS" with no warranties, and confers no rights. ... >>> newsgroup purposes only. ...
    (microsoft.public.development.device.drivers)
  • Re: Documents & Settings Path
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... Please do not send e-mail directly to this alias. ... This alias is for newsgroup purposes only. ... > I like Microsoft Newsgroups, ...
    (microsoft.public.win2000.general)

Loading