unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw, ToolWin, ComCtrls;
type
TForm1 =
class(TForm)
WebBrowser1: TWebBrowser;
CoolBar1: TCoolBar;
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
procedure WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch;
var URL: OleVariant);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
geradeerstgeladen:boolean;
// wichtig
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Navigate('
http://lakeparty.de');
geradeerstgeladen:=true;
end;
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch;
var URL: OleVariant);
begin
if geradeerstgeladen
then begin
WebBrowser1.OleObject.document.forms.item(0).elements.item('
username').value:=Edit1.Text;
WebBrowser1.OleObject.document.forms.item(0).elements.item('
password').value:=Edit2.Text;
Webbrowser1.OleObject.document.forms.item(0).submit;
geradeerstgeladen:=false;
end;
end;
end.