Показать сообщение отдельно
  #5  
Старый 08.11.2010, 17:23
plat1num plat1num вне форума
Прохожий
 
Регистрация: 07.11.2010
Сообщения: 6
Репутация: 10
По умолчанию

Код:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  IdHTTP, StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Label1: TLabel;
    Button1: TButton;
    IdHTTP1: TIdHTTP;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
s : string;
i : integer;
begin
randomize;
i := random(Memo1.Lines.Count-1);
s := IdHTTP1.Get('http://anekdotov.net/anekdot/random/'+memo1.Lines.strings[i]+'.html?');
Label1.Caption := Copy(s, pos('<td valign=top>', s) + 15, pos('<center>', s) - pos('<td valign=top>', s) -15);

end;

end.
вот код но что то не так
Ответить с цитированием