应该不难,但急用,请给说清楚些。谢谢了~

解决方案 »

  1.   

    <INPUT NAME="uc_uid" Value="hello">
      

  2.   

    如果你知道文本框的名字的话,你可以使用下面的代码:procedure TForm1.Button2Click(Sender: TObject);
    var
      Doc: IHTMLDocument2;
      Form : IHTMLFormElement;
      Elements: IHTMLElementCollection;
      InputElem : IHTMLInputElement;
      i : Integer;
    begin
      Doc := wbIE.Document as IHTMLDocument2;
      Elements := Doc.Forms as IHTMLElementCollection;
      Form := Elements.Item(0,varEmpty) as IHTMLFormElement;
      Elements := (Doc.All as IHTMLElementCollection).tags('input') as IHTMLElementCollection;
      for i := 0 to Elements.length-1 do
      begin
        InputElem := Elements.Item(i, varEmpty) as IHTMLInputElement;    if UpperCase(Trim(InputElem.name)) = 'Name' then
          InputElem.Value := 'aaa';
        if UpperCase(Trim(InputElem.name)) = 'Password' then
          InputElem.Value := 'bbb';
      end;  for i := 0 to Elements.length-1 do
      begin
        InputElem := Elements.Item(i, varEmpty) as IHTMLInputElement;    if UpperCase(Trim(InputElem.type_)) = 'submit' then
          (InputElem as IHTMLInputButtonElement).form.submit;// := 'bbb';
      end;
    passwor)end;上面的代码填充wbIE中的页面中的name和password两个文本框。
      

  3.   

    我要填的是一个File, 就是那个选文件上传的那个,这个东西很特殊,它不能通过Value赋值方式设置初始值(因为这有安全问题, 你不想访问某个页面自已硬盘上的某个文件就被传到人家的服务器上吧)所以,我必须用发消息的方式,模拟手工输入来填充它。但这一块我不会,又着急,因此向这方面的高人求教。
      

  4.   

    关于file,我问过微软专家,基于安全性的考虑,webbrowser控件不支持通过程序设置file的值。