Hi,
also bei klappt meine Function einwandfrei aber ich hab Isdn hier der Code dafür:
Code:
function RasConnectionCount: Integer;
var
RasDLL: HInst;
Conns: array[1..4] of TRasConn;
RasEnums: TRasEnumConnections;
BufSize: DWORD;
NumConns: DWORD;
RasResult: Longint;
begin
Result := 0;
RasDLL := LoadLibrary('rasapi32.dll');
if RasDLL = 0 then Exit;
try
RasEnums := GetProcAddress(RasDLL, 'RasEnumConnectionsA');
if @RasEnums = nil then
raise ERasError.Create('RasEnumConnectionsA not found in rasapi32.dll');
Conns[1].dwSize := SizeOf(Conns[1]);
BufSize := SizeOf(Conns);
RasResult := RasEnums(@Conns, BufSize, NumConns);
if (RasResult = 0) or (Result = cERROR_BUFFER_TOO_SMALL) then Result := NumConns;
finally
FreeLibrary(RasDLL);
end;
end;
Function Online():String;
begin
if rasconnectioncount = 0 then
result:='Offline'
else
result:='Online'
end;
Wieviel Lösungen hat die Gleichung x^13=1? .... 13!