Czy jest jakaś funkcja, która rozłączy Internet bez względu na typ internetu jaki posiadamy? (radiówka, router, kablówka, ADSL i tak dalej...)
0
0
mozesz odpalic ipconfig /release
0
{Wykorzystaj systemowy program:
IPconfig.exe dla XP
IPcfg.exe dla 98
}
uses ShellApi;
procedure PolaczInternet(Status: Boolean);
begin
if Status then
begin
if Win32Platform = VER_PLATFORM_WIN32_NT then ShellExecute(Application.Handle, 'open', 'ipconfig', '/renew', nil, SW_HIDE)
else ShellExecute(Application.Handle, 'open', 'ipcfg.exe', '/renew_all', nil, SW_HIDE);
end
else
begin
if Win32Platform = VER_PLATFORM_WIN32_NT then ShellExecute(Application.Handle, 'open', 'ipconfig', '/release', nil, SW_HIDE)
else ShellExecute(Application.Handle, 'open', 'ipcfg.exe', '/release_all', nil, SW_HIDE);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
PolaczInternet(True);
end;