Read wireless adapter's IP in .NET CF

  • Thread starter Thread starter Stephan Baune
  • Start date Start date
S

Stephan Baune

Hey guys,

I've searched a lot and didn't find a suitable solution for my problem
which I'm about to describe.
I'm responsible for the network stuff in a university project which is
an application for PDAs with Windows Mobile 2003 SE. Because it's M$
and the general *ahem* crappiness of J2ME and virtual machines for
mobile devices we decided to implement everything with the help of .NET
CF and C#.

What the PDAs do: On startup they connect to a dedicated wireless lan
and receive their IP from the AP's DHCP server. All they get is an IP,
Subnet mask and a Gateway IP so no DNS IP because we don't have a DNS
and no Internet Connection.

Now my question: How can I read the IP that the wireless adapter is
assigned to (preferrably in C#)?
If I used the normal .NET framework or had a DNS server then I'd be
fine but without these? There must be a solution?

I'd be thankful for every response!

Thanks for reading,
Stephan
 
You didn't find that? I'm seriously surprised. That is, if the program to
get the IP is *on the PPC*. Is it? If so, the code to do that is dead
simple in OpenNETCF's Smart Device Framework. You can use 1.0 or 2.0.

Paul T.
 
Paul said:
You didn't find that? I'm seriously surprised. That is, if the program to
get the IP is *on the PPC*. Is it? If so, the code to do that is dead
simple in OpenNETCF's Smart Device Framework. You can use 1.0 or 2.0.

No, I didn't find that, I'm sorry.
It is on the Pocket PC, yes.

Is it also dead simple to be more precise? Thank you.
 
Sure, write the stuff we did yourself. Really, that's how it would be done.
We didn't do anything magic - we just wrote P/Invoke wrappers around all of
the WZC APIs.

-Chris



Stephan Baune said:
Isn't there a way to do this without the OpenNETCF?

http://opennetcf.org/library/OpenNETCF.Net.Adapter.CurrentIpAddress.html

-Chris


Stephan Baune said:
Paul G. Tobey [eMVP] wrote:
You didn't find that? I'm seriously surprised. That is, if the
program
to
get the IP is *on the PPC*. Is it? If so, the code to do that is
dead
simple in OpenNETCF's Smart Device Framework. You can use 1.0 or 2.0.

No, I didn't find that, I'm sorry.
It is on the Pocket PC, yes.

Is it also dead simple to be more precise? Thank you.


Paul T.

Hey guys,

I've searched a lot and didn't find a suitable solution for my
problem
which I'm about to describe.
I'm responsible for the network stuff in a university project which
is
an application for PDAs with Windows Mobile 2003 SE. Because it's M$
and the general *ahem* crappiness of J2ME and virtual machines for
mobile devices we decided to implement everything with the help of
.NET
CF and C#.

What the PDAs do: On startup they connect to a dedicated wireless
lan
and receive their IP from the AP's DHCP server. All they get is an
IP,
Subnet mask and a Gateway IP so no DNS IP because we don't have a
DNS
and no Internet Connection.

Now my question: How can I read the IP that the wireless adapter is
assigned to (preferrably in C#)?
If I used the normal .NET framework or had a DNS server then I'd be
fine but without these? There must be a solution?

I'd be thankful for every response!

Thanks for reading,
Stephan
 
The OpenNETCF source is available on their web site, just copy the bits you
want.

Simon.

Stephan Baune said:
Isn't there a way to do this without the OpenNETCF?

http://opennetcf.org/library/OpenNETCF.Net.Adapter.CurrentIpAddress.html

-Chris


Stephan Baune said:
Paul G. Tobey [eMVP] wrote:
You didn't find that? I'm seriously surprised. That is, if the
program
to
get the IP is *on the PPC*. Is it? If so, the code to do that is
dead
simple in OpenNETCF's Smart Device Framework. You can use 1.0 or 2.0.

No, I didn't find that, I'm sorry.
It is on the Pocket PC, yes.

Is it also dead simple to be more precise? Thank you.


Paul T.

Hey guys,

I've searched a lot and didn't find a suitable solution for my
problem
which I'm about to describe.
I'm responsible for the network stuff in a university project which
is
an application for PDAs with Windows Mobile 2003 SE. Because it's M$
and the general *ahem* crappiness of J2ME and virtual machines for
mobile devices we decided to implement everything with the help of
.NET
CF and C#.

What the PDAs do: On startup they connect to a dedicated wireless
lan
and receive their IP from the AP's DHCP server. All they get is an
IP,
Subnet mask and a Gateway IP so no DNS IP because we don't have a
DNS
and no Internet Connection.

Now my question: How can I read the IP that the wireless adapter is
assigned to (preferrably in C#)?
If I used the normal .NET framework or had a DNS server then I'd be
fine but without these? There must be a solution?

I'd be thankful for every response!

Thanks for reading,
Stephan
 
Back
Top