A
angel725
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
begin
web.Navigate('mail.163.com');
(((web.Document as IHTMLDocument2).body.all as
IHTMLElementCollection).item('username',0) as IHTMLTextAreaElement).value:='a'; //错在这行
(((web.Document as IHTMLDocument2).body.all as
IHTMLElementCollection).item('password',0) as IHTMLTextAreaElement).value :='b'
end;
运行后出现一个对话框:
Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 0045AF0A in module 'Project1.exe'. Read of address 00000000'. Process stopped. Use Step or Run to continue.
为什么呢?
会因为我的网页没有打开吗?(出错的时候网页没有显示出来呢)
begin
web.Navigate('mail.163.com');
(((web.Document as IHTMLDocument2).body.all as
IHTMLElementCollection).item('username',0) as IHTMLTextAreaElement).value:='a'; //错在这行
(((web.Document as IHTMLDocument2).body.all as
IHTMLElementCollection).item('password',0) as IHTMLTextAreaElement).value :='b'
end;
运行后出现一个对话框:
Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 0045AF0A in module 'Project1.exe'. Read of address 00000000'. Process stopped. Use Step or Run to continue.
为什么呢?
会因为我的网页没有打开吗?(出错的时候网页没有显示出来呢)