DelphiÖУ¢Á÷£¢µÄÀûÓÃ
ʲôÊÇÁ÷£¿Á÷,¼òµ¥À´Ëµ¾ÍÊǽ¨Á¢ÔÚÃæÏò¶ÔÏó»ù´¡ÉϵÄÒ»ÖÖ³éÏóµÄ´¦ÀíÊý¾Ý
µÄ¹¤¾ß¡£ÔÚÁ÷ÖУ¬¶¨ÒåÁËһЩ´¦ÀíÊý¾ÝµÄ»ù±¾²Ù×÷£¬Èç¶ÁÈ¡Êý¾Ý£¬Ð´ÈëÊý¾ÝµÈ£¬
³ÌÐòÔ±ÊǶÔÁ÷½øÐÐËùÓвÙ×÷µÄ£¬¶ø²»ÓùØÐÄÁ÷µÄÁíһͷÊý¾ÝµÄÕæÕýÁ÷Ïò¡£Á÷²»
µ«¿ÉÒÔ´¦ÀíÎļþ£¬»¹¿ÉÒÔ´¦Àí¶¯Ì¬ÄÚ´æ¡¢ÍøÂçÊý¾ÝµÈ¶àÖÖÊý¾ÝÐÎʽ¡£Èç¹ûÄã¶Ô
Á÷µÄ²Ù×÷·Ç³£ÊìÁ·£¬ÔÚ³ÌÐòÖÐÀûÓÃÁ÷µÄ·½±ãÐÔ£¬Ð´Æð³ÌÐò»á´ó´óÌá¸ßЧÂʵġ£
ÏÂÃ棬±ÊÕßͨ¹ýËĸöʵÀý:EXEÎļþ¼ÓÃÜÆ÷¡¢µç×Ӻؿ¨¡¢×ÔÖÆOICQºÍÍøÂçÆÁÄ»
´«ÊäÀ´ËµÃ÷Delphi±à³ÌÖГÁ÷”µÄÀûÓá£ÕâЩÀý×ÓÖеÄһЩ¼¼ÇÉÔø¾ÊǺܶàÈí
¼þµÄÃØÃܶø²»¹«¿ªµÄ£¬ÏÖÔÚ´ó¼Ò¿ÉÒÔÎÞ³¥µÄÖ±½ÓÒýÓÃÆäÖеĴúÂëÁË¡£
“ÍòÕɸߥƽµØÆ𔣬ÔÚ·ÖÎöʵÀý֮ǰ£¬ÎÒÃÇÏÈÀ´Á˽âÒ»ÏÂÁ÷µÄ»ù±¾¸ÅÄîºÍ
º¯Êý£¬Ö»ÓÐÔÚÀí½âÁËÕâЩ»ù±¾µÄ¶«Î÷ºóÎÒÃDzÅÄܽøÐÐÏÂÒ»²½¡£ÇëÎñ±ØÈÏÕæÁì»á
ÕâЩ»ù±¾·½·¨¡£µ±È»£¬Èç¹ûÄã¶ÔËüÃÇÒѾºÜÊìϤÁË£¬Ôò¿ÉÒÔÌø¹ýÕâÒ»²½¡£
Ò»¡¢DelphiÖÐÁ÷µÄ»ù±¾¸ÅÄî¼°º¯ÊýÉùÃ÷
ÔÚDelphiÖУ¬ËùÓÐÁ÷¶ÔÏóµÄ»ùÀàΪTStreamÀ࣬ÆäÖж¨ÒåÁËËùÓÐÁ÷µÄ¹²Í¬ÊôÐÔ
ºÍ·½·¨¡£
TStreamÀàÖж¨ÒåµÄÊôÐÔ½éÉÜÈçÏ£º
1¡¢Size:´ËÊôÐÔÒÔ×Ö½Ú·µ»ØÁ÷ÖÐÊý¾Ý´óС¡£
2¡¢Position:´ËÊôÐÔ¿ØÖÆÁ÷ÖдæÈ¡Ö¸ÕëµÄλÖá£
TstreamÖж¨ÒåµÄÐé·½·¨ÓÐËĸö£º
1¡¢Read:´Ë·½·¨ÊµÏÖ½«Êý¾Ý´ÓÁ÷ÖжÁ³ö¡£º¯ÊýÔÐÎΪ£º
Function Read(var Buffer;Count:Longint):Longint;virtual;abstract;
²ÎÊýBufferΪÊý¾Ý¶Á³öʱ·ÅÖõĻº³åÇø£¬CountΪÐèÒª¶Á³öµÄÊý¾ÝµÄ×Ö½ÚÊý£¬
¸Ã·½·¨·µ»ØֵΪʵ¼Ê¶Á³öµÄ×Ö½ÚÊý£¬Ëü¿ÉÒÔСÓÚ»òµÈÓÚCountÖÐÖ¸¶¨µÄÖµ¡£
2¡¢Write:´Ë·½·¨ÊµÏÖ½«Êý¾ÝдÈëÁ÷ÖС£º¯ÊýÔÐÎΪ£º
Function Write(var Buffer;Count:Longint):Longint;virtual;abstract;
²ÎÊýBufferΪ½«ÒªÐ´ÈëÁ÷ÖеÄÊý¾ÝµÄ»º³åÇø£¬CountΪÊý¾ÝµÄ³¤¶È×Ö½ÚÊý£¬
¸Ã·½·¨·µ»ØֵΪʵ¼ÊдÈëÁ÷ÖеÄ×Ö½ÚÊý¡£
3¡¢Seek:´Ë·½·¨ÊµÏÖÁ÷ÖжÁÈ¡Ö¸ÕëµÄÒƶ¯¡£º¯ÊýÔÐÎΪ£º
Function Seek(Offset:Longint;Origint:Word):Longint;virtual;abstract;
²ÎÊýOffsetΪƫÒÆ×Ö½ÚÊý,²ÎÊýOrigintÖ¸³öOffsetµÄʵ¼ÊÒâÒ壬Æä¿ÉÄܵÄÈ¡Öµ
ÈçÏ£º
sofromBeginning:OffsetΪÒƶ¯ºóÖ¸Õë¾àÀëÊý¾Ý¿ªÊ¼µÄλÖᣴËʱOffset±ØÐë
´óÓÚ»òÕßµÈÓÚÁã¡£
sofromCurrent:OffsetΪÒƶ¯ºóÖ¸ÕëÓ뵱ǰָÕëµÄÏà
Ïà¹ØÎĵµ£º
ʲôÊǶà̬£¬×ÖÃæÒâ˼¾ÍÊÇ“¶àÖÖÐÎ̬”£¬ÓöÔÏóÀ´½²¾ÍÊÇ×ÓÀà¼Ì³Ð»ùÀ࣬¶ø²»Í¬µÄ×ÓÀàÓÖ·Ö±ð¶Ô»ùÀà½øÐй¦ÄܵÄÀ©Õ¹¡£
¶à̬ÔÚObject PascalÖÐÊÇͨ¹ýÐé·½·¨ÊµÏֵģ¨Virtual Method£©,ÔÚObject PascalÖлùÀàµÄÐé·½·¨ÊÇ¿ÉÒÔ±»ÅÉÉúÀา¸Ç£¨Override£©µÄ ......
ÃüÁîģʽ¿ÉÒÔºÜÇáËɵÄʵÏÖ³·Ïú£¨Undo£©¹¦ÄÜ¡£
1. ÃüÁîµÄ½ÓÊÜÕß
unit uReceiveObject;
interface
type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;
implementation
{ TLight }
procedure TLight.Off;
begin
Writeln('Light is off.');
......
1. ÃüÁîµÄ½ÓÊÜÕß
unit uReceiveObject;
interface
type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;
TGarageDoor = class(TObject)
public
procedure Up;
procedure Down;
procedure Stop;
procedure LightOn;
procedure LightOff;
end; ......
´ó¼Ò¶¼ÈÏΪ£¬CÓïÑÔÖ®ËùÒÔÇ¿´ó£¬ÒÔ¼°Æä×ÔÓÉÐÔ£¬ºÜ´ó²¿·ÖÌåÏÖÔÚÆäÁé»îµÄÖ¸ÕëÔËÓÃÉÏ¡£Òò´Ë£¬ËµÖ¸ÕëÊÇCÓïÑÔµÄÁé»ê£¬Ò»µã¶¼²»Îª¹ý¡£Í¬Ê±£¬ÕâÖÖ˵·¨Ò²ÈúܶàÈ˲úÉúÎó½â£¬ËƺõÖ»ÓÐCÓïÑÔµÄÖ¸Õë²ÅÄÜËãÖ¸Õë¡£Basic²»Ö§³ÖÖ¸Õ룬Ôڴ˲»ÂÛ¡£Æäʵ£¬PascalÓïÑÔ±¾ÉíÒ²ÊÇÖ§³ÖÖ¸ÕëµÄ¡£´Ó×î³õµÄPascal·¢Õ¹ÖÁ½ñµÄObject Pascal£¬¿ÉÒÔ˵ÔÚÖ¸ÕëÔËÓ ......
Ò»¡¢ÔÚDelphi7ÖÐÁ¬½ÓMS SQL Server 2000µÄ·½·¨¡£
¸Õ¿ªÊ¼Ê±½çÃæÈçÏ£ºÌí¼Ó4¸ö¿Ø¼þ¡£
ÉèÖÿؼþÊôÐÔ¹ý³Ì£º
1¡¢ADOConnection1ÉèÖÃ
1£©Ë«»÷ADOConnection1£¬½øÐÐÉèÖÃÁ¬½Ó×Ö·û´®£¨×÷ÓÃÊÇ£ºÑ¡È¡Á¬½ÓÇý¶¯·½Ê½ºÍÁ¬½ÓµÄÊý¾Ý¿âÉèÖã©¡£¹ý³ÌÈçÏÂͼËùʾ£º
2¡¢ADOQuery1ÉèÖãº
1£©ADOQuery1.connectionÊôÐÔΪADOConnection1; ......