|
非常简单的代码
HRASCONN hRasConn = NULL;
RASDIALPARAMS rdParams; //拨号连接的信息
ZeroMemory(&rdParams, sizeof(RASDIALPARAMS));
rdParams.dwSize = sizeof(RASDIALPARAMS);
lstrcpy(rdParams.szEntryName, _T("gprs"));
lstrcpy(rdParams.szUserName,_T(""));
lstrcpy(rdParams.szPassword,_T(""));
DWORD dwRet;
dwRet = ::RasDial(NULL, NULL, &rdParams, 0L, NULL , &hRasConn); //如果函数成功,则返回0
if (dwRet)
{
MessageBox(_T("false"), _T("false"), MB_OK | MB_SETFOREGROUND);
}
else
{
MessageBox(_T("ok"), _T("ok"), MB_OK | MB_SETFOREGROUND);
} |
|