请教各位如何控制ADSL拨号? ( 积分: 200 )

  • 主题发起人 主题发起人 无忧鱼
  • 开始时间 开始时间

无忧鱼

Unregistered / Unconfirmed
GUEST, unregistred user!
现在因为需要,用软件来控制ADSL拨号(拨号网络事先手工已建好),小虾不知如何写这个程序,还望各位援手。最好贴一点代码出来。。。多谢!
 
现在因为需要,用软件来控制ADSL拨号(拨号网络事先手工已建好),小虾不知如何写这个程序,还望各位援手。最好贴一点代码出来。。。多谢!
 
可以看看此贴
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1343405
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
 
Delphi版本:
function RasEnumEntries(reserved: PChar; lpszPhonebook: PChar;
lprasentryname: PRasEntryName; var lpcb: DWORD;
var lpcEntries: DWORD): DWORD; stdcall;

function RasGetEntryDialParams(lpszPhonebook: PChar;
var lprasdialparams: TRasDialParams; var lpfPassword: BOOL): DWORD; stdcall;

function RasDial(lpRasDialExtensions: PRasDialExtensions; lpszPhonebook: PChar;
lpRasDialParams: PRasDialParams; dwNotifierType: DWORD; lpvNotifier: Pointer;
var lphRasConn: THRasConn): DWORD; stdcall;

function RasHangUp(hrasconn: THRasConn): DWORD; stdcall;

function RasEnumEntries; external raslib name 'RasEnumEntriesA';

function RasGetEntryDialParams; external raslib name 'RasGetEntryDialParamsA';

function RasDial; external raslib name 'RasDialA';

function RasHangUp; external raslib name 'RasHangUpA';
 
后退
顶部