Einzelnen Beitrag anzeigen

capo

Registriert seit: 7. Jul 2006
453 Beiträge
 
Delphi 11 Alexandria
 
#10

Re: Formular ausfüllen für upload

  Alt 11. Jul 2006, 16:51
hab da was gefunden

Delphi-Quellcode:
procedure TForm1.SetFilename(Value: WideString);

var

  Doc: IHTMLDocument2;

  Elements: IHTMLElementCollection;

  Element: IHTMLElement;

  InputElement: IHTMLInputElement;

  I, j: Integer;

  FormItem: Variant;

  pch: PChar;

  str1: string;

begin

  str1 := Value; //convert input value to string

  pch := PChar(str1); //type cast to pointer



  Doc := WebBrowser1.Document as IHTMLDocument2;

  Elements := Doc.all;

  for I := 0 to Elements.length - 1 do

  begin

    Element := Elements.item(I, EmptyParam) as IHtmlElement;

    if Element.tagName = 'INPUTthen

    begin

      InputElement := Element as IHTMLInputElement;

      if (SameText(InputElement.type_, 'file')) and

        (SameText(InputElement.Name, 'RemoteName')) then

      begin

        FormItem := InputElement;

        FormItem.Focus;

        SendKeys(PCh, False); // NOTE the false flag

      end;

    end;

  end;

end;
quelle:
http://groups.yahoo.com/group/delphi...r/message/6832

gruss, capo
Hotte
  Mit Zitat antworten Zitat