Исходники и листинги ::: Delphi ::: WhoIs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  unit confunit;
  interface
  uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls, ExtCtrls;
  type
    TForm2 = class(TForm)
      Panel1: TPanel;
      Edit1: TEdit;
      Label1: TLabel;
      procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    private
    public
    end;
  var
    Form2: TForm2;
  implementation
  uses mainunit;
  {$R *.dfm}
  procedure TForm2.Edit1KeyPress(Sender: TObject; var Key: Char);
  begin
   if key = #13 then
   begin
    try
    form2.Close;
    form1.IdWhois.Host := copy(edit1.Text, 1, pos(':',edit1.Text)-1);
    form1.IdWhois.Port := strtoint(copy(edit1.Text, pos(':',edit1.Text)+1, length(edit1.Text)));
    except
    end;
   end;
  end;
  end.
  unit mainunit;
  interface
  uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, XPMan, StdCtrls, ExtCtrls, IdBaseComponent, IdComponent,
    IdTCPConnection, IdTCPClient, IdWhois;
  type
    TForm1 = class(TForm)
      Panel1: TPanel;
      Label1: TLabel;
      Edit1: TEdit;
      Button1: TButton;
      Panel2: TPanel;
      resultmemo: TMemo;
      IdWhois: TIdWhois;
      procedure Button1Click(Sender: TObject);
      procedure FormShow(Sender: TObject);
    private
    public
    end;
  var
    Form1: TForm1;
  implementation
  uses confunit;
  {$R *.dfm}
  procedure TForm1.Button1Click(Sender: TObject);
  var
    line, fineresult: string;
    ipos: integer;
  begin
   resultmemo.Text := 'Searching...';
   try
   fineresult := idwhois.WhoIs(edit1.Text);
   except
   end;
   while length(fineresult) > 0 do
   begin
    ipos := pos(#10,fineresult);
    line := copy(fineresult, 1, ipos-1);
    resultmemo.Lines.Add(line);
    delete(fineresult, 1, length(line)+1);
   end;
  end;
  procedure TForm1.FormShow(Sender: TObject);
  begin
   form2.ShowModal;
  end;
  end.
<<< Предыдущая работа

Вернуться в галерею исходников
WhoIs
Автор: Moonglow*
Город: Бабруйск
Дата: 20.01.2007  18:24
Комментариев: 0
Просмотров: 222
Оценка: 0 (0|0|0|0|0) [0]

Вернуться на главную
Авторский комментарий к работе: Листинг моего варинта WhoIsа
Вы не можете оценивать

КОММЕНТАРИИ К РАБОТЕ:
Нет комментариев