webbrowser名字为web自己修改要填写的用户名密码部分第一次见到这么简单的验证码.....var sDisp:IDispatch; doc2:IHtmlDocument2; doc3:IHtmlDocument3; inel:IHTMLInputElement; el:IHTMLElement; frmel:IHTMLFormElement; fw:IHTMLWindow2; str:string; i:integer; jlevariant;begin doc3:=nil; try doc2:=web.Document as Ihtmldocument2; for i:=0 to doc2.frames.length-1 do begin j:=i; sdisp:=doc2.frames.item(j); if SUCCEEDED(sDisp.QueryInterface(IHTMLWindow2,fw)) and (pos('loginWork',fw.document.url)>0) then begin doc3:=fw.document as Ihtmldocument3; break; end; end; if not assigned(doc3) then exit; el:=doc3.getElementById('BNLoginUserName'); {用户名} if assigned(el) and Succeeded(el.QueryInterface(IHTMLInputElement,inel)) then inel.value:='test'; {用户名} el:=doc3.getElementById('BNLoginCompanyName'); {@后面的} if assigned(el) and Succeeded(el.QueryInterface(IHTMLInputElement,inel)) then inel.value:='test'; {@后面的} el:=doc3.getElementById('BNLoginPassword'); {密码} if assigned(el) and Succeeded(el.QueryInterface(IHTMLInputElement,inel)) then inel.value:='test'; {密码} str:=''; el:=doc3.getElementById('oldrand2'); {获得验证码} if assigned(el) and Succeeded(el.QueryInterface(IHTMLInputElement,inel)) then str:=inel.value; el:=doc3.getElementById('check'); {验证码} if assigned(el) and Succeeded(el.QueryInterface(IHTMLInputElement,inel)) then inel.value:=str; {验证码} el:=doc3.getElementById('loginForm'); if assigned(el) and Succeeded(el.QueryInterface(IHTMLFormElement,frmel)) then frmel.submit; except end;end;