! CODEBANK 2012 !
İNDİRMEK&DETAYLI BİLGİ ALMAK İÇİN BURAYI TIKLAYINIZ.
ÖNEMLİ AÇIKLAMA: MUTLAKA OKUYUNUZ!
0 Üye ve 1 Ziyaretçi konuyu incelemekte.
procedure TForm1.Button1Click(Sender: TObject);begin IdTelnet1.Disconnect(); try IdTelnet1.Host := '127.0.0.1'; IdTelnet1.Port := 1433; //IdTelnet1.Terminal:='vt100'; IdTelnet1.Connect(); ShowMessage('Bağlandı'); except ShowMessage('Bağlantı hatası.....'); end;end;
function CheckDBConnection(IP: string): Boolean;var Telnet: TIdTelnet;begin Telnet := TIdTelnet.Create(nil); try with Telnet do begin if Connected then Disconnect; Host := IP; Port := 1433;//(Sql server TCP port) try Connect(1000); Result := True; except Result := False; end; end; finally Telnet.Disconnect; Telnet.Free; end;end;
procedure TForm1.Button2Click(Sender: TObject);begin if CheckDBConnection('127.0.0.1') then ShowMessage('Bağlandı') else ShowMessage('Bağlantı hatası.....');end;
function ServerExist(Port: Word; Host: String): Boolean;var IdTelnet: TIdTelnet;begin IdTelnet := TIdTelnet.Create(nil); try IdTelnet.Host := Host; IdTelnet.Port := Port; try try IdTelnet.Connect; Result := True; except Result := False; end; finally IdTelnet.Disconnect; end; finally IdTelnet.Disconnect; IdTelnet.Free; end;end;
procedure TForm1.Button3Click(Sender: TObject);begin if ServerExist(1433,'T1') then ShowMessage('Bağlandı') else ShowMessage('Bağlantı hatası.....');end;
procedure TForm1.Button1Click(Sender: TObject);var myportstatus : boolean;begin IdEcho1.Host := '127.0.0.1'; IdEcho1.Port := 77; IdEcho1.Connect; myportstatus := IdEcho1.Connected; IdEcho1.Disconnect; if myportstatus = true then Label1.Caption := 'server açık' else Label1.Caption := 'server kapalı';end;
function CheckNetConnection(IP: string): Boolean;var Echo: TIdEcho;begin Echo := TIdEcho.Create(nil); with Echo do begin try Host := IP; Port := 1433; Connect(1000); Result := True; except Result := False; end; end; Echo.Free;end;
procedure TForm1.Button2Click(Sender: TObject);begin if CheckNetConnection('127.0.0.1') then showmessage('bağlandı...') else showmessage('bağlanamadı...')end;
function checkport(Aecho: TIdEcho; ip2scan:string; port2scan:string):boolean; begin Aecho.Host := ip2scan; Aecho.Port := strtoint(port2scan); try Aecho.Connect(0); Aecho.Disconnect; result := true; except result := false; end;end;
procedure TForm1.Button3Click(Sender: TObject);begin if checkport(IdEcho1,'127.0.0.1','1433') = true then ShowMessage('bağlandı') else ShowMessage('bağlantı hatası');end;