Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Testa se um servidor proxy está ativo
- //Adicione 1 button.
- //Adicione 2 edit.
- //Adicione 1 memo.
- //by SuPrEm3 (Daniel/Nerd)
- //Object Pascal - Delphi
- function TestaProxy(host: string; port: word):boolean;
- var
- TcpClient1: TTcpClient;
- begin
- try
- TcpClient1:=TTcpClient.Create(neo);
- TcpClient1.RemoteHost:=Host;
- TcpClient1.RemotePort:=IntToStr(porta);
- if TcpClient1.Connect
- then begin
- result:= true;
- TcpClient1.Disconnect;
- end
- else result:= false;
- finally
- TcpClient1.Free;
- end;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- if TestaProxy(Edit1.Text, StrToInt(Edit2.Text)) then
- begin
- Memo1.Lines.Add('Proxy ativo!');
- end else
- begin
- Memo1.Lines.Add('Proxy inativo!');
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement