I need to enable/disable network adapters from my VB.NET code, e.g. enable
wlan, disable lan. I know the names of the adapters, so I've thought about
using an api call like the one that is used by the "Network connection
manager" (connmc.exe); there you can choose an adapter from a list, and
enable/disable it. But I haven't found this function, yet. Can anybody point
me into the right direction? Maybe I can "automate" this connmc.exe, meaning
start the exe from my code, select the specific adapter from the list
control, "click" the menu???
Btw, I read about binding, rebinding and unbinding an adapter? What does
this mean? Is it disabling the adapter or is it a kind of reset of the
adapter?
With kind regards,
Thorsten Kleinhenz
Paul T.
"Thorsten Kleinhenz" <Thorsten...@discussions.microsoft.com> wrote in
message news:E2560D79-7577-4FE6...@microsoft.com...
But i cannot figure out how to do a NDIS bind or NDIS unbind through VB.net.
The only API that i have found is:
VOID NdisMRebindProtocolsToAdapter(
NDIS_HANDLE MiniportAdapterHandle
);
But I do not know how to P/Invoke this function because of the NDIS_HANDLE
struct as it's argument. Any help on how to do an NDIS bind or NDIS unbind
through VB.net ?
Paul T.
"Dante" <Da...@discussions.microsoft.com> wrote in message
news:F634902C-D5E7-46D2...@microsoft.com...
Regards,
Thorsten
Binding is loading the adapter and attaching it, virtually, to each protocol
stack that the registry wants it connected to. On the desktop, this might
make connections between the adapter, TCP/IP, IPX/SPX (if you are using
NetWare on your network), etc. On Windows CE, it basically just connects
the adapter to TCP/IP. When it's bound, the TCP/IP stack has to get an IP
address for it (by reading it from the registry, if it's a static address,
or by contacting a DHCP server, if that's the configuration), etc.
Paul T.
"Thorsten Kleinhenz" <Thorsten...@discussions.microsoft.com> wrote in
message news:3CCF281B-0645-4BE0...@microsoft.com...
Paul T.
"KAUSHIK BOSE" <kaushik...@yahoo.co.in> wrote in message
news:89205b73108342c7...@ureader.com...
Does any body know how do i disable LAN connection on WIN CE 5 device through my program.
Thanks in advance....
Best Regards,
Prajwal
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/
If you want to disable the adapter just during the current session (until
the next reboot), you can unbind it from NDIS, after telling NDIS to unpower
the adapter. OpenNETCF's Smart Device Framework has suitable methods for
doing the unbind of an adapter. You'll probably have to unpower the adapter
yourself (although OpenNETCF does have the P/Invoke for SetDevicePower()).
The best reference to this is the actual connection manager code for Windows
CE, which, if you are the device vendor, you can find in
\PUBLIC\COMMON\OAK\DRIVERS\CONNMC.
If you want to permanently disable the adapter (have the adapter disable
after reboot), you have to set a flag in the registry entry for the adapter,
and unbind/unpower it (and save the registry, of course).
Paul T.
"Prajwal" <prajw...@gmail.com> wrote in message
news:260e9012-dfe2-4b6e...@developmentnow.com...