Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

delphiÖÐIhtmldocument2½Ó¿ÚµÄʹÓÃ

MSHTMLÊÇ΢Èí¹«Ë¾µÄÒ»¸öCOM×é¼þ£¬¸Ã×é¼þ·â×°ÁËHTMLÓïÑÔÖеÄËùÓÐÔªËؼ°ÆäÊôÐÔ£¬Í¨¹ýÆäÌṩµÄ±ê×¼½Ó¿Ú£¬¿ÉÒÔ·ÃÎÊÖ¸¶¨ÍøÒ³µÄËùÓÐÔªËØ£®
¡¡¡¡MSHTML¶ÔÏóÄ£ÐÍÊÇÓÉһЩ¶ÔÏóºÍ¼¯ºÏ×é³ÉµÄ£®´¦ÓÚ¸ù²¿µÄÊÇHTML£¬ÃèÊöÁË´ò¿ªÒ³ÃæµÄ1¸ö´°¿Ú£¬°üÀ¨Ò»ÏµÁм¯ºÏºÍ¶ÔÏó¡£ÈçFrames¼¯ºÏ£¬History£¬Location£¬Navigator£¬Document£¬Vi—sum£¬Event¶ÔÏóµÈ£®ÆäÖÐÃèÊö³ÊÏÖÔÚ¿Í»§´°¿Úʵ¼ÊÍøÒ³µÄÊÇDocument¶ÔÏó¡£ÓÉһϵÁеÄÊôÐÔ¡¢·½·¨¡¢¶ÔÏóºÍ¼¯ºÏ×é³É£®ÆäÖÐAll¼¯ºÏÖаüº¬ÍøÒ³ÖÐËùÓбê¼Ç(Tag)ÔªËØ£¬ÆäÖ÷ÒªµÄ·½·¨ºÍÊôÐÔÓУº
¡¡¡¡(1)Length(³¤¶È)£º¼´±ê¼Ç³öÏֵĸöÊý£¬¿ÉÒ԰ѱê¼ÇµÄ¼¯ºÏÀí½âΪ´Ó0¿ªÊ¼µÄһάÊý×飬Æä´ÎÐò°´ÕÕ±ê¼ÇÔÚÍøҳλÖÃÅÅÁУ»
¡¡¡¡(2)Tags(±ê¼Ç)£ºÓÃÓÚ¹ýÂ˳ö¸ø¶¨±ê¼ÇµÄ¼¯ºÏ£¬ÈçDoc£®Al1£®Tags(P)µÃµ½ËùÓзֶαê¼ÇP£»
¡¡¡¡(3)Item(ÏîÄ¿)£ºÓÃÓÚÑ¡Ôñ¼¯ºÏÖеÄij1¸öÔªËØ£¬Èçobject£®item(0)µÃµ½¼¯ºÏµÄµÚ1¸öÔªËØ£¬¶øobject£®item(i)µÃµ½µÚi+1¸öÔªËØ£®
¡¡¡¡´ËÍ⣬IHTMLElementÒ²ÊǸö³£Óõļ¯ºÏ¶ÔÏ󣬴ú±íÍøÒ³ÖÐÖ¸¶¨±ê¼ÇµÄ¼¯ºÏ£¬Í¨¹ýÕâ¸ö¼¯ºÏ¶ÔÏ󣬿ÉÒԵõ½ÍøÒ³ÉÏÌض¨±ê¼ÇµÄÄÚÈÝ£®IHTMLElementÓÐ4¸öÖ÷ÒªÊôÐÔ£º
¡¡¡¡(1)InnerText£º¿ªÊ¼±ê¼ÇºÍ½áÊø±ê¼ÇÖ®¼äµÄÎı¾£»
¡¡¡¡(2)InnerHTML£º¿ªÊ¼±ê¼ÇºÍ½áÊø±ê¼ÇÖ®¼äµÄÎı¾ºÍHTML£»
¡¡¡¡(3)OuterText£º¶ÔÏóµÄÎı¾£»
¡¡¡¡(4)OuterHTML£º¶ÔÏóµÄÎı¾ºÍHTML£®
×¢Ò⣺ʹÓÃÇ°¼ÓÈëµ¥Ôªmshtml
ÑÝʾ±íµ¥Ìá½»
procedure TForm1.Button1Click(Sender: TObject);
var
Doc:IHTMLDocument2;
input:OleVariant;
userinputelement,pwdinputelement:ihtmlinputelement;
begin
doc:=webbrowser1.document as ihtmldocument2;
userinputelement:=(doc.all.item('user'(Ò²¾ÍÊÇÍøÒ³ÖÐÓû§Ãû¿Ø¼þµÄÃû×Ö),0) as ihtmlinputelement);
userinputelement.value:=edit1.text;(Ò²¾ÍÊÇÄãÒªÏòÍøÒ³ÊäÈëµÄ¶«Î÷)
pwdinputelement:=(doc.all.item('password',0) as ihtmlinputelement);
pwdinputelement.value:=edit2.text;
input:=doc.all.item('submit',0);
input.click;
end;
µ±Ìá½»Êý¾Ý°´Å¥Ã»ÓÐNAMEÊôÐÔʱ£¬²ÉÓÃÈçÏ·½·¨£º
procedure TForm1.Button1Click(Sender: TObject);
var
Doc:IHTMLDocument2;
form:ithmlformelement;
userinputelement,pwdinputelement:ihtmlinputelement;
begin
doc:=webbrowser1.document as ihtmldocument2;
userinputelement:=(doc.all.item('user'(Ò²¾ÍÊÇÍøÒ³ÖÐÓû§Ãû¿Ø¼þµÄÃû×Ö),0) as ihtml


Ïà¹ØÎĵµ£º

DelphiÖÐÈ¡Õûº¯ÊýRoundµÄBug½â¾ö

DelphiÖÐ Roundº¯ÊýÓиöBug
Ò»µ©²ÎÊýÊÇÐÎÈç XXX.5ÕâÑùµÄÊýʱ
Èç¹û XXX ÊÇÆæÊý ÄÇô¾Í»á Round up
Èç¹û XXX ÊÇżÊý ÄÇô¾Í»á Round down
ÀýÈç Round(17.5)=18
µ«ÊÇ Round(12.5)=12
ÏÂÃæµÄº¯Êý¼´¿É¾ÀÕýÕâ¸ö Bug µ«ÊÇÊÇÁÙʱÐÔµÄ
Ö´ÐÐ DoRound(12.5) ½á¹ûΪ 13 ÕýÈ·
 function DoRound(Value: Extended): Int64;
......

»ùÓÚDelphiµÄSocket I/OÄ£ÐÍÈ«½Ó´¥(×ܽá) [ת]

ת×Ô´ó¸»ÎÌhttp://www.delphibbs.com/keylife/iblog_show.asp?xid=30049
ÀϳÂÓÐÒ»¸öÔÚÍâµØ¹¤×÷µÄÅ®¶ù£¬²»Äܾ­³£»ØÀ´£¬ÀϳºÍËýͨ¹ýÐżþÁªÏµ¡£ËûÃǵÄÐŻᱻÓʵÝԱͶµÝµ½ËûÃǵÄÐÅÏäÀï¡£
¡¡¡¡ÕâºÍSocketÄ£Ðͷdz£ÀàËÆ¡£ÏÂÃæÎÒ¾ÍÒÔÀϳ½ÓÊÕÐżþΪÀý½²½âSocket I/OÄ£ÐÍ¡£
¡¡¡¡Ò»£ºselectÄ£ÐÍ
¡¡¡¡Àϳ·dz£Ïë¿´µ½Å®¶ùµÄÐÅ¡£ÒÔÖ ......

Delphi + DBµÄ²éѯÓÅ»¯Éè¼Æ˼Ïë

¾­µä°¸Àý·ÖÏí Ôݲ»Éæ¼°·ÖÇø±í,±íÉè¼ÆµÈ Ö»´Ó±È½ÏdzµÄ½Ç¶ÈÀ´ÓÅ»¯
1.Ïȼì²é³ÌÐò ¼ì²éÄ£ÐͲãµÄÉè¼ÆÓë±àÂëÊÇ·ñºÏÀí ½«ºÍÕâ¸ö±íÓÐÓа󶨵ÄÊý¾Ý¸ÐÖª¿Ø¼þÈ«²¿È¥µô¡£
2.¹ÀËãÒ»¸öÊý¾ÝµÄ×î´óÁ¿ ¿ÉÒÔ´ÓÉè¼Æ½Ç¶È Ò²¿ÉÒÔ´Ó¿Í»§ÌṩµÄÊý¾Ý·ÖÎö δÀ´Ò»¶¨ÖÜÆÚÄÚµÄÔ¤Ôö³¤Á¿
3.½«ÌõÂëµÄ³¤¶È±£´æÆðÀ´£¬ÏÈÓÃÌõÂëµÄ³¤¶È½øÐйýÂË£¬Èç¹û80%ÒÔÉϵ ......

DelphiÖ¸ÕëÀàÐÍdzÎö(¸½¼þ)

¸½¼þ×ÊÁÏ
*Ö¸ÕëµÄʹÓ㨴úÂ룩
ʾÀý£º¼òµ¥µÄÖ¸ÕëÓ¦ÓÃ
´úÂ룺
procedure TForm1.Button2Click(Sender: TObject);
var
    a: Integer;
    p: ^Integer;
begin
    with self.Memo1.Lines do
    begin
        ......

delphi DBGridÓ¦ÓôóÈ«

 ÔÚ Delphi ÓïÑÔµÄÊý¾Ý¿â±à³ÌÖУ¬DBGrid ÊÇÏÔʾÊý¾ÝµÄÖ÷ÒªÊÖ¶ÎÖ®Ò»¡£µ«ÊÇ DBGrid ȱʡµÄÍâ¹ÛδÃâÏԵõ¥µ÷ºÍȱ·¦´´Òâ¡£Æäʵ£¬ÎÒÃÇÍêÈ«¿ÉÒÔÔÚÎÒÃǵijÌÐòÖÐͨ¹ý±à³ÌÀ´´ïµ½ÃÀ»¯DBGrid Íâ¹ÛµÄÄ¿µÄ¡£Í¨¹ý±à³Ì£¬ÎÒÃÇ¿ÉÒԸıä DBGrid µÄ±íÍ·¡¢Íø¸ñ¡¢Íø¸ñÏßµÄÇ°¾°É«ºÍ±³¾°É«£¬ÒÔ¼°Ïà¹ØµÄ×ÖÌåµÄ´óСºÍ·ç¸ñ¡£
    ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ