Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Preferred way to get IP from DHCP...

IP DHCP network

Best Answer herbsti72, 04 March 2015 - 01:24 PM

HI Terrence,

 

you need to reference "Microsoft.SPOT.Net" Assembly, afterwards try following code to get IP with DHCP:

var interf = NetworkInterface.GetAllNetworkInterfaces()[0];
//Get Dynamic IP
interf.EnableDhcp();
interf.RenewDhcpLease();

For more information take a look on this project:

http://neonmikawebserver.codeplex.com/

 

It contains also other usefully network related code and how to setup simple webserver on N2+

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 Terrence

Terrence

    Member

  • Members
  • PipPip
  • 24 posts

Posted 02 March 2015 - 05:06 PM

What is the preferred library to get an IP address from my DHCP server?

I can't seem to find a consensus.

 

Thank you.

Terrence

 

 



#2 Terrence

Terrence

    Member

  • Members
  • PipPip
  • 24 posts

Posted 04 March 2015 - 02:27 AM

So no one accesses the internet from their nd+2? 

 

Surely someone is using this great platform to hit the internet.



#3 herbsti72

herbsti72

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationVienna, Austria

Posted 04 March 2015 - 01:24 PM   Best Answer

HI Terrence,

 

you need to reference "Microsoft.SPOT.Net" Assembly, afterwards try following code to get IP with DHCP:

var interf = NetworkInterface.GetAllNetworkInterfaces()[0];
//Get Dynamic IP
interf.EnableDhcp();
interf.RenewDhcpLease();

For more information take a look on this project:

http://neonmikawebserver.codeplex.com/

 

It contains also other usefully network related code and how to setup simple webserver on N2+



#4 Terrence

Terrence

    Member

  • Members
  • PipPip
  • 24 posts

Posted 04 March 2015 - 02:52 PM

Herb, thanks for the info and the link.  Just what I was looking for.

Terrence







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.