uses
ExtCtrls, mshtml, OleCtrls, ClipBrd, SHDocVw, WinInet, shellapi, URLMon,
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,JPEG;
type
TForm1 = class(TForm)
WebBrowser1: TWebBrowser;
Memo1: TMemo;
Button1: TButton;
Button2: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
type
IHTMLElementRender = interface(IUnknown)
['{3050F669-98B5-11CF-BB82-00AA00BDCE0B}']
function DrawToDC
( _hDC: HDC
): HResult; stdcall;
end;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function DownloadFile(SourceFile, DestFile: string): Boolean;
begin
try
Result := UrlDownloadToFile(nil, PChar(SourceFile), PChar(DestFile), 0, nil) = 0;
except
Result := False;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
const
// URL Location
SourceFile = 'ссылка на нужную картинку';
// Where to save the file
DestFile = 'c:\temp\капча.gif';
begin
if DownloadFile(SourceFile, DestFile) then
begin
ShowMessage('Download succesful!');
end
else
ShowMessage('Error while downloading ' + SourceFile)
end;
он выдерает капчу с ссылки,а как сделать так что бы он выдерал эту картинку сразу с браузера, а то капча меняется и картинки не соответствуют друг другу(
__________________
Ставь спасибо за спасибо!
Помог?Ставь спасибо!Увидел пост? Поставь спасибо!