{+++++++++++++++++++++++
取当前所有的拨号连接的程式;
参数为传入的列表,过程成功为参数付值且返回值为真
否则为假;
调用方法类似
if GetEntries(Memo1.Lines) then
begin
end
else
begin
end;
Date:2001/03/07 12:30-----13:32
Remark:
+++++++++++++++++++++++++++++++++++++++++++++++++++++
}
function TForm1.GetEntries(List: TStrings):Boolean;
type
TRasEntryName = record
Size : DWORD;
EntryName: array[0..256] of Char;
end;
var
FRasLibHandle : THandle;
RasEntries : array[1..25] of TRasEntryName;
Size : DWORD;
Count : DWORD;
i : DWORD;
RasEnumEntries : TRasEnumEntries;
begin
// if List=Nil then Exit;
try
List.Clear;
FRasLibHandle:=LoadLibrary(RasAPI32);
try
if FRasLibHandle=0 then Exit;
@RasDial:=GetProcAddress(FRasLibHandle,'RasDialA');
拨号后挂起程式
TRasHangUp = function(RassCon : THandle) : DWORD; stdcall;
@RasHangUp:=GetProcAddress(FRasLibHandle,'RasHangUpA');
类同}
@RasEnumEntries:=GetProcAddress(FRasLibHandle,'RasEnumEntriesA');
if @RasEnumEntries=nil then Exit;
RasEntries[1].Size:=SizeOf(TRasEntryName);
Size:=SizeOf(RasEntries);
if RasEnumEntries(nil,nil,@RasEntries,Size,Count)=0 then
begin
for i:=1 to Count do
List.Add(RasEntries.EntryName);
end;
Result:=True;
finally
FreeLibrary(FRasLibHandle);
end;
except
end;