Показать сообщение отдельно
  #3  
Старый 22.07.2011, 15:18
sanya920 sanya920 вне форума
Прохожий
 
Регистрация: 22.07.2011
Сообщения: 13
Репутация: 10
По умолчанию

Код:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
  function GetSubStr(InputStr, BeginStr, EndStr: String): String;
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function TForm1.GetSubStr(InputStr, BeginStr, EndStr: String): String;
var
  s: String;
  sp, ep: Integer;
begin
  Result := '';
  if pos(BeginStr, InputStr) <> 0 then begin
    sp := pos(BeginStr, InputStr)+length(BeginStr);
    s := copy(InputStr,sp,length(InputStr));
    ep := pos(EndStr,s)-1;
    Result := copy(s,1,ep);
  end;
end;




procedure TForm1.Button1Click(Sender: TObject);
var
mf:TIdMultiPartFormDataStream;
s,ssilochka:string;
id:TIdHTTP;
begin
  id:=TIdHTTP.Create(nil);
  mf:=TIdMultiPartFormDataStream.Create;
  mf.AddFile('file','file.rar','application/octet-stream');
  mf.AddFormField('desc','');
  mf.AddFormField('password','666');
  mf.AddFormField('send','Отправить!');
  s:=id.Post('http://upwap.ru/upload/',mf);
  GetSubStr('<input type="text" value="',s,'" /></div></form></div>');
  showmessage(s);
  id.Free;
end;

end.
где тут ошибка?
Ответить с цитированием