I've never done this from any of the managed code languages. I've shown the
code in C++ below. Note that buf is the Unicode string with the adapter
name in it. This is the same string that you found in the registry: the
name of the adapter plus the index number (usually "1").
Paul T.
-----
// Open the NDIS driver.
HANDLE hNdis = CreateFile( _T( "NDS0:" ),
GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, 0, NULL );
// Send the device command.
TCHAR errs[ 512 ];
DWORD xcount;
if ( DeviceIoControl( hNdis, IOCTL_NDIS_REBIND_ADAPTER,
buf, _tcslen( buf ) + sizeof( TCHAR ),
NULL, 0, &xcount, NULL ) )
{
OutputDebugString( _T( "Adapter rebound\r\n" ) );
}
else
{
_stprintf( errs, _T( "DeviceIoControl failed. error = %d\r\n" ),
GetLastError() );
OutputDebugString( errs );
}
CloseHandle( hNdis );
-----
Gavin Gonsal said:
Paul,
Thank you for your quick answer. Im relatively new to VB.NEt and not dont
any P/Invoking (only used examples by others). Could you give me a sample
code? Im using VB.Net. Also, any good websites/material where I can learn
registry programming with WinCE ?
This problem of wireless connectivity and IP addresses is critical to my
application as it relies heavily on wireless connectivity.