E
Ekin
Unregistered / Unconfirmed
GUEST, unregistred user!
那个帮我看看!是想定时登陆网页.procedure TForm1.Timer1Timer(Sender: TObject);var Nowtime: string; sSql,code:string; doc:ihtmldocument2; inputlevariant; user,pwd:ihtmlinputelement;begin Nowtime:=FormatDateTime('HH:MM',Now); sSql:='SELECT CODE FROM ITM WHERE LEFT(SENDTIME,5)='''+Nowtime+''' '; ADOQuery1.SQL.Text:=sSql; ADOQuery1.Open; if not ADOQuery1.IsEmpty then begin Timer1.Enabled:=False; code:=ADOQuery1.fieldByname('CODE').AsString; webbrowser1.Navigate('http://www.www.com/id='+code+''); Sleep(10000); doc:=webbrowser1.document as ihtmldocument2; user:=(doc.all.item('LoginId',0) as ihtmlinputelement);//███ 老是内存报错, user.value:=edit1.Text; pwd:=(doc.all.item('password',0) as ihtmlinputelement); pwd.value:=edit2.Text; input:=doc.all.item('submit',0); input.click; Timer1.Enabled:=True; end;end;