P
pepsicool6
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.AutoLogin;
var
Item,Name:OleVariant;
begin
if not isAutoLogin then
begin
try
Name:='username';
Item:=Webbrowser1.OleObject.Document.all.item(Name,0);
Item.innerText:=edt_user.text;<========网页中input type='text',没有问题
Name:='password';
Item:=Webbrowser1.OleObject.Document.all.item(Name,0);
Item.innerText:=edt_pwd.text;<========网页中input type='text',没有问题
Name:='uploadfile';
Item:=Webbrowser1.OleObject.Document.all.item(Name,0);
Item.innerText:=edt_uploadfile.text;<===网页中input type='file',出现问题
Name:='Submit';
Item:=WebBrowser1.OleObject.document.all.item(Name,0);
Item.Click;
isAutoLogin:=true;
except
showmessage('加载页面忙,请稍后再试!')
end;
end;
end;
怎样才能向input type=file的输入框中自动填写数据?
var
Item,Name:OleVariant;
begin
if not isAutoLogin then
begin
try
Name:='username';
Item:=Webbrowser1.OleObject.Document.all.item(Name,0);
Item.innerText:=edt_user.text;<========网页中input type='text',没有问题
Name:='password';
Item:=Webbrowser1.OleObject.Document.all.item(Name,0);
Item.innerText:=edt_pwd.text;<========网页中input type='text',没有问题
Name:='uploadfile';
Item:=Webbrowser1.OleObject.Document.all.item(Name,0);
Item.innerText:=edt_uploadfile.text;<===网页中input type='file',出现问题
Name:='Submit';
Item:=WebBrowser1.OleObject.document.all.item(Name,0);
Item.Click;
isAutoLogin:=true;
except
showmessage('加载页面忙,请稍后再试!')
end;
end;
end;
怎样才能向input type=file的输入框中自动填写数据?