断开拨号连接
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;