皖
===========================================================================
用RAS操作ADSL。
①.RasEnumEntries
The RasEnumEntries function lists all entry names in a remote access phone book.
②.RasSetEntryProperties
The RasSetEntryProperties function changes the connection information for an entry in the phone book or creates a new phone-book entry.
函数原型:
DWORD RasSetEntryProperties(
__in LPCTSTR lpszPhonebook,
__in LPCTSTR lpszEntry,
__in LPRASENTRY lpRasEntry,
__in DWORD dwEntryInfoSize,
__in LPBYTE lpbDeviceInfo,
__in DWORD dwDeviceInfoSize
);
第三个参数参照MSDN。
除了上面(MSDN)说的几个成员需要提供外。
还有
dwSize 推荐:sizeof(RASENTRY)-------------此成员不设置函数会返回632
dwfOptions2 推荐:RASEO2_Internet---------见图2.
dwfNetProtocols 推荐:RASNP_Ip------------见图1.
对于要求的dwfOptions 推荐:RASEO_RemoteDefaultGateway(见图2.) |RASEO_ModemLights(见图3.)
③.RasDial
The RasDial function establishes a RAS connection between a RAS client and a RAS server. The connection data includes callback and user-authentication information.
④.RasEnumConnections
The RasEnumConnections function lists all active RAS connections. It returns each connection's handle and phone-book entry name.
⑤.RasHangUp
The RasHangUp function terminates a remote access connection. The connection is specified with a RAS connection handle. The function releases all RASAPI32.DLL resources associated with the handle.
图1.
图2.
图3.