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

[Delphiº¯Êý]ÌáÉý½ø³ÌȨÏÞΪDEBUGȨÏÞ

ÔÚÍøÉÏÒ²¿´µ½ÁËһЩÌáÉý½ø³ÌÁîÅƵĺ¯Êýµ«¶¼²»ÔõôºÃÓÃ,×îºóÎÒ»¹ÊÇ´ÓÒ»¸öºÚ¿ÍºóÃųÌÐòµÄÔ´´úÂëÖÐÌáÈ¡³öÁËÒ»¸öºÃµÄÌáÉý½ø³ÌÁîÅƵĺ¯Êý,²»¸Ò¶ÀÏí,¸ú´ó¼Ò·ÖÏíÏÂ.ÄǸöºóÃÅÕæµÄдµÄºÜºÃ...
HysiaÌáʾÄã:
Õâ¸öº¯ÊýÓÃÔÚ¶Ô¸¶²¡¶¾µÄ³ÌÐòÖÐЧ¹ûºÜºÃ,Ö»ÓÐÌáÉý×ÔÉíȨÏÞ²ÅÄÜKILLµô²¡¶¾½ø³ÌÎÒÔøдд³öÀ´³¢ÊÔ½áÊøWinlogon½ø³Ì,µ¼ÖµĽá¹ûÊÇ,ÎҵĵçÄÔÁ¢¿ÌÀ¶ÆÁºóÖØÆô!
//ÌáÉý½ø³ÌȨÏÞΪDEBUGȨÏÞ
procedure SetPrivilege;
var
   OldTokenPrivileges, TokenPrivileges: TTokenPrivileges;
   ReturnLength: dword;
   hToken: THandle;
   Luid: int64;
begin
   OpenProcessToken(GetCurrentProcess, TOKEN_ADJUST_PRIVILEGES, hToken);
   LookupPrivilegeValue(nil, 'SeDebugPrivilege', Luid);
   TokenPrivileges.Privileges[0].luid := Luid;
   TokenPrivileges.PrivilegeCount := 1;
   TokenPrivileges.Privileges[0].Attributes := 0;
   AdjustTokenPrivileges(hToken, False, TokenPrivileges, SizeOf(TTokenPrivileges), OldTokenPrivileges, ReturnLength);
   OldTokenPrivileges.Privileges[0].luid := Luid;
   OldTokenPrivileges.PrivilegeCount := 1;
   OldTokenPrivileges.Privileges[0].Attributes := TokenPrivileges.Privileges[0].Attributes or SE_PRIVILEGE_ENABLED;
   AdjustTokenPrivileges(hToken, False, OldTokenPrivileges, ReturnLength, PTokenPrivileges(nil)^, ReturnLength);
end;
Ó÷¨¾Í²»ÓÃ˵ÁË°É,
procedure TForm1.FormCreate(Sender: TObject);
begin SetPrivilege; ...
Ò»¾ä»°¾Í°Ñ³ÌÐòÌáÉýΪDEBUGȨÏÞÁË,È»ºó¾Í¿ÉÒÔËæ±ã½áÊøÆäËû½ø³ÌÁË.
ºÃ¶«Î÷¸ú´ó¼Ò·ÖÏí~!


Ïà¹ØÎĵµ£º

Delphi ´´½¨Ä¿Â¼¼°Ð´ÈÕÖ¾Îļþ


Delphi ´´½¨Ä¿Â¼¼°Ð´ÈÕÖ¾Îļþ
var
TF: TextFile;
LogFile: string;
txt :string;
sysDir:string;
//´´½¨°´Å¥
procedure TForm1.Button1Click(Sender: TObject);
begin
sysDir:=extractfilepath(application.ExeName );
if not directoryexists(sysdir+'log\') then
createdir(sysdir+'log ......

delphiÖеÄDBGRidÊó±ê¹ö¶¯Ê¼þ

Procedure OnMouseWheel(Var Msg :TMsg;var Handled:Boolean);
begin
  if Msg.message = WM_MouseWheel then
  begin
    if Msg.wParam > 0 then
     begin
       if DBGrid.Focused then
       ......

ÔÙ̸Delphi vs VC++(·Ç³£¾«²Ê) (ת)

żȻÀ´ÕÒÒ»¸öÎļþ£¬È´·¢ÏÖÕâÀï¹ØÓÚvc++ºÍDelphiµÄÌÖÂÛºÜÊǼ¤ÁÒ¡£¿´ÁË´ó¼ÒдµÄһЩ
ÎÄÕ£¬¾õµÃÓÐЩ¿´·¨ÕýÈ·£¬ÓÐЩ¾ÍºÜÆ«ÆÄÉõÖÁ´íÎó(Ò²ÐíÎÞÖª£¿ºÜ±§Ç¸ÎÒÕâÑù˵:-)¡£ÎÒ
ÎÞÒâÓëÈκÎÈËÕùÂÛ£¬¸üÔ¸Òâ°ÑÕâ¿´³ÉÊǼ¼ÊõÉϵÄÌÖÂÛ¡£Ó¦¸Ã±¾×Ź«Õý£¬²»´øÆ«¼ûµÄ̬¶È
(Õâ²¢²»Òâζ×Å·ÇҪƽ·ÖÇïÉ«£¬Ò»ÇÐÓ¦ÒÔÊÂʵΪ׼)¡£ÎÒÓùý³ýtp1ÒÔÍâµÄËùÓ ......

DelphiÖÐADOÒì²½Ö´Ðз½Ê½

     µ±A D O¿ªÊ¼´¦ÀíÊý¾Ýºó£¬Ó¦ÓóÌÐò±ØÐëµÈµ½A D O´¦ÀíÍê±ÏÖ®ºó²Å¿ÉÒÔ¼ÌÐøÖ´ÐС£µ«
ÊdzýÁËͬ²½Ö´Ðз½Ê½Ö®Í⣬ A D OÒ²ÌṩÁËÒì²½Ö´Ðеķ½Ê½£¬ÔÊÐíµ±A D O´¦Àíʱ£¬
Ó¦ÓóÌÐòÈÔÈ»Äܹ»ÏȼÌÐøÖ´ÐС£¶øµ±A D O´¦ÀíÊý¾ÝÍê±ÏÖ®ºó£¬ A D O»áÒÔʼþµÄ·½
ʽ֪ͨӦÓóÌÐò£¬´ËʱӦÓóÌÐò¿ÉÒÔÔÙ¸ù¾ÝA D OÖ´ÐÐµÄ ......

DelphiÀàÐÍת»»


Chr ½«Ò»¸öÓÐÐòÊý¾Ýת»»ÎªÒ»¸öANSI×Ö·û  
Ord ½«Ò»¸öÓÐÐòÀàÐÍֵת»»ÎªËüµÄÐòºÅ  
Round ×ª»»Ò»¸öʵÐÍֵΪËÄÉáÎåÈëºóµÄÕûÐÍÖµ  
Trunc ×ª»»Ò»¸öʵÐÍֵΪСÊý½Ø¶ÏºóµÄÕûÐÍÖµ  
Int ·µ»Ø¸¡µãÊýµÄÕûÊý²¿·Ö  
IntToStr ½«Êýֵת»»Îª×Ö· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ