Delphi²Ù×÷×¢²á±íµÄÒ»°ã²½Öè
Delphi²Ù×÷×¢²á±í²½ÖèÈçÏ£º
-------------------------------------
1£©ÔÚUsesÖÐÌí¼ÓRegistryµ¥Ôª£»
2£©ÉùÃ÷TRegistry¶ÔÏó£»
3£©´´½¨TRegistry¶ÔÏó£»
4£©Ö¸¶¨¸ù¼ü£»
----------------try------------------
5£©´ò¿ªÐèÒª²Ù×÷µÄÖ÷¼ü£»
6£©¶Áд²Ù×÷£»
7£©±£´æ²¢¹Ø±ÕÖ÷¼ü£»
--------------finally----------------
8£©ÊÍ·ÅTRegistry¶ÔÏó£»
---------------end------------------
==========================================================
Uses Registry; //Ìí¼ÓRegistryµ¥Ôª£»
var
MyReg: TRegistry; //ÉùÃ÷TRegistry¶ÔÏó£»
begin
MyReg := TRegistry.Create; //´´½¨TRegistry¶ÔÏó£»
try
MyReg.RootKey := HKEY_LOCAL_MACHINE; //Ö¸¶¨¸ù¼ü£»
if MyReg.OpenKey('Ö÷¼üÃû', true) then //´ò¿ªÐèÒª²Ù×÷µÄÖ÷¼ü£»
begin
MyReg.ReadType(---); //¶Á×¢²á±íÎļþ
MyReg.WriteType(---); //дע²á±íÎļþ
end;
MyReg.CloseKey; //±£´æ²¢¹Ø±ÕÖ÷¼ü£»
finally
MyReg.Free; //ÊÍ·ÅTRegistry¶ÔÏó£»
end;
end;
==========================================================
function OpenKey(const Key:String; CanCreate:Boolean):Boolean;
//µÚ¶þ¸ö²ÎÊýÖ¸Ã÷£¬Èç¹ûÐèÒª´ò¿ªµÄÖ÷¼ü²»´æÔÚʱÊÇ·ñ´´½¨¸ÃÖ÷¼ü
function CreateKey(const Key:String):Boolean;
//´Ë·½·¨ÓÃÓÚ´´½¨Ö÷¼ü£¬Êµ¼ÊÉϲ¢²»³£ÓÃ
function KeyExists(const Key:String):Boolean;
//ÅжÏÖ÷¼üÊÇ·ñ´æÔÚ
(***¶ÔÓÚ×Ö·û´®ÀàÐ͵IJÙ×÷º¯Êý***)
function ReadString(const Name: String):String;
procedure WriteString(const Name, Value: String);
//¶ÔÓÚÆäËüÊý¾ÝÀàÐ͵Ä×¢²á±í¶Áд
Ïà¹ØÎĵµ£º
Ò»¡¢Formatº¯ÊýµÄÓ÷¨
FormatÊÇÒ»¸öºÜ³£Óã¬È´ÓÖËƺõºÜ·³µÄ·½·¨£¬±¾ÈËÊÔͼ¶ÔÕâ¸ö·½·¨µÄ°ïÖú½øÐÐһЩ·Ò룬ÈÃËüÓÐÒ»¸öÍêÕûµÄ¸Åò£¬ÒÔ¹©´ó¼Ò²éѯ֮Óãº
Ê×ÏÈ¿´ËüµÄÉùÃ÷£º
function Format(const Format: string; const Args: array of const): string; overload;
ÊÂʵÉÏFormat·½·¨ÓÐÁ½¸öÖÖÐÎʽ£¬ÁíÍâÒ»ÖÖÊÇÈý¸ö²ÎÊýµÄ£¬Ö ......
ÎÄÕÂÀ´Ô´£ºIT¹¤³ÌÐÅÏ¢Íø http://www.systhinker.com/html/09/n-12309.html
֮ǰÓÃAccess×÷Ò»¸öÓ¦Ó㬵«ÕÒ²»µ½»õ±Òת»»³É´óдÈËÃñ±ÒµÄ¹¦ÄÜ£¨µ±È»¿ÉÒÔͨ¹ýexcel ת»»£¬µ«²»ÔÚÒ»¸öÓ¦ÓÃÉÏ£¬·ÅÆú£©¡£ÒÔΪ±È½Ï¼òµ¥£¬×Ô¼ºÊÔд£¬ËÖªÓÃÁËÁ½¸öÍíÉÏ£¬²Å»ù±¾ÊµÏÖ£¬µ«Ã»ÓÐСÊýµã£¨Ôª£©ÒÔÏ»õ±ÒµÄת»»¡£Ò²Ã»ÓÐÕ×µÄÅжϡ£¶øÇÒ¶Ô×Ö· ......
Ò») ʹÓö¯Ì¬´´½¨µÄ·½·¨
Ê×ÏÈ´´½¨ Excel ¶ÔÏó£¬Ê¹ÓÃComObj:
var ExcelApp: Variant;
ExcelApp := CreateOleObject( 'Excel.Application'  ......
ADO¶àÏß³ÌÊý¾Ý¿â²éѯͨ³£»á³öÏÖ3¸öÎÊÌ⣺
1¡¢CoInitialize ûÓе÷ÓÃ
£¨CoInitialize was not
called£©£»ËùÒÔ£¬ÔÚʹÓÃÈκÎdbGo¶ÔÏóÇ°£¬±ØÐëÊÖ
µ÷ÓÃCoInitializeºÍCoUninitialize¡£µ÷ÓÃCoInitializeʧ°Ü»á²úÉú"CoInitialize was not
called"ÀýÍâ¡£
2¡¢»²¼²»ÔÊÐí»æ»
£¨Canvas does not allow
drawing£ ......
3.2 Óû§µÇ¼·½°¸
ÔÚ½øÈëÒ»¸öϵͳʱ£¬±ØÐëÏÈÔڵǼ´°ÌåÖÐÊäÈëÕýÈ·µÄÓû§ÃûºÍÃÜÂë²ÅÄܽøÈë¡£ÕâÑù¿ÉÒÔÈ·±£ÏµÍ³µÄ°²È«ÐԺͱ£ÃÜÐÔ£¬µÇ¼´°ÌåµÄÖÆ×÷°´ÕÕϵͳµÄ´óС¼°Óô¦£¬¿ÉÒÔ·ÖΪ²»Í¬µÄµÇ¼´°ÌåÑùʽ£¬ÔÚϵͳµÚÒ»´ÎµÇ¼ǰ£¬Ê×ÏÈÒª¶Ô²Ù×÷Ô±ÐÅÏ¢½øÐÐÏàÓ¦µÄÉèÖᣱ¾½Ú½«¶ÔµÇ¼´°Ìå¼°²Ù×÷Ô±¹ÜÀí´°ÌåµÄÖÆ×÷¹ý³Ì½øÐÐÏêϸµÄ˵Ã÷ ......