IE的自动拨号和挂断

  • 主题发起人 主题发起人 import
  • 开始时间 开始时间
I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
automatically dial/hangup the default Internet connection? uses
WinInet;
// Causes the modem to automatically dial the default Internet connection.
procedure TForm1.Button1Click(Sender: TObject);
var
dwConnectionTypes: DWORD;
begin
dwConnectionTypes := INTERNET_CONNECTION_MODEM + INTERNET_CONNECTION_LAN +
INTERNET_CONNECTION_PROXY;
if not InternetGetConnectedState(@dwConnectionTypes, 0) then
// not connected
if not InternetAutodial(INTERNET_AUTODIAL_FORCE_ONLINE or
INTERNET_AUTODIAL_FORCE_UNATTENDED, 0) then
begin
// error
end;
end;
 
// hangup the default Internet connection.
procedure TForm1.Button2Click(Sender: TObject);
var
dwConnectionTypes: DWORD;
begin
dwConnectionTypes := INTERNET_CONNECTION_MODEM + INTERNET_CONNECTION_LAN +
INTERNET_CONNECTION_PROXY;
if InternetGetConnectedState(@dwConnectionTypes, 0) then
// connected
InternetAutodialHangup(0);
end;
 
后退
顶部