Questo programma dovrebbe impostare le caselle di testo su una pagina html (che sta suo mio HD) ma non funziona bene.
Programma delphi:e quello della pagina html:codice:function GetElementByName(doc: IHTMLDocument2 ;name: string):IHTMLElement; begin Result:=(doc.all.item(name,0) as IHTMLElement); end; var D:IHTMLDocument2; E:IHTMLElement; begin W.Navigate(PATH+'prova.html'); while (W.Busy) do begin Application.ProcessMessages end; d:=(W.Document as IHTMLDocument2); E:=GetElementByName(d,'user'); E.innerText:='test'; E:=GetElementByName(d,'password'); E.innerText:='test2';
L'errore lo da alla riha "e.innertext" perchè E risulta nil..codice:<html> <body> <form name="f" method="post"> Nome:<input type="text" name="user" size="30" MAXLENGTH="30"> Password:<input type="password" name="password" size="20" MAXLENGTH="20"> </form></body></html>
Come mai?? Grazie

Rispondi quotando
