我以前有过一个控件,找来找去找不到在哪里了,于是只好翻 Help 和 MSDN ,录下主要 API 如下:
LIB : RASAPI32.DLL
DWORD RasEnumEntries ( // 取得拨号连接
LPCTSTR reserved, // reserved, must be NULL
LPTCSTR lpszPhonebook, // pointer to full path and filename of phone-book file
LPRASENTRYNAME lprasentryname, // buffer to receive phone-book entries
LPDWORD lpcb, // size in bytes of buffer
LPDWORD lpcEntries // number of entries written to buffer
);
DWORD RasGetEntryDialParams( //取得拨号参数
LPCTSTR lpszPhonebook, // pointer to the full path and filename of the phone-book file
LPRASDIALPARAMS lprasdialparams, // pointer to a structure that receives the connection parameters
LPBOOL lpfPassword // indicates whether the user's password was retrieved
);
DWORD RasDial( //拨号
LPRASDIALEXTENSIONS lpRasDialExtensions, // pointer to function extensions data
LPCTSTR lpszPhonebook, // pointer to full path and filename of phone-book file
LPRASDIALPARAMS lpRasDialParams, // pointer to calling parameters data
DWORD dwNotifierType, // specifies type of RasDial event handler
LPVOID lpvNotifier, // specifies a handler for RasDial events
LPHRASCONN lphRasConn // pointer to variable to receive connection handle
);
DWORD RasHangUp( //挂断
HRASCONN hrasconn // handle to the RAS connection to hang up
);
你先看看。