访问量: 30801次,访客数: 26152人,浏览量: 1次 
首页  编辑  

断开拨号连接

Tags: /超级猛料/Network.网络通讯/FTP和拨号/   Date Created: Tue May 14 2002 07:41:42 GMT+0000 (Coordinated Universal Time)

断开拨号连接

function DisconnectActiveConnection: Boolean;

var

 RasEntry: TRasEntry;

 EntryInfoSize: Cardinal;

 DeviceInfoSize: Cardinal;

 RasGetEntryPropertiesResult: Integer;

begin

 ZeroMemory(@RasEntry, SizeOf(TRasEntry));

 RasEntry.dwSize := SizeOf(TRasEntry);

 EntryInfoSize := SizeOf(TRasEntry);

 RasGetEntryPropertiesResult := RasGetEntryProperties(nil,

MyActiveEntryName), @RasEntry, EntryInfoSize, nil, DeviceInfoSize);

 if (RasGetEntryPropertiesResult = 0) then

   Result := DisconnectDevice(StrPas(RasEntry.szDeviceName));

end;