Changing a Windows CE machines IP address programatically?
-
06-07-2019 - |
Question
How do I change the IP address of a Windows CE machine?
I want to do it from .NET Compact Framework!
Solution
You can alter the current IP address by writing a new value out to the registry at HKLM\comm[adaptername]\Parms\Tcpip. Keep in mind that this is a multi-sz value and that for the change to take affect, you must call the NDIS driver with the IOCTL_NDIS_REBIND_ADAPTER IOCTL.
As Shaihi points out, the Smart Device Framework already ahs all of this wrapped up in the NetworkInterface.CurrentIpAddress property.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow