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

delphiÆô¶¯·þÎñÍ£Ö¹·þÎñн¨·þÎñµÄ·½·¨

 
unit Servicescontrol;
   
interface  
uses Windows,Messages,SysUtils,Winsvc,Dialogs;
   
function StartServices(Const SvrName:String):Boolean;
function StopServices(Const SvrName:String):Boolean;
function QueryServiceStatu(Const SvrName:   String):String;
function CreateServices(Const SvrName,FilePath:String):Boolean;  
function DeleteServices(Const SvrName: String):Boolean;  
   
implementation  
   
//¿ªÆô·þÎñ  
function StartServices(Const   SvrName:   String):   Boolean;
var  
      a,b:SC_HANDLE;  
        c:PChar;  
begin  
        Result:=False;  
   
        a:=OpenSCManager(nil,nil,SC_MANAGER_ALL_ACCESS);  
   
        if a <=0 then Exit;  
   
        b:=OpenService(a,PChar(SvrName),SERVICE_ALL_ACCESS);  
   
        if b <=0 then Exit;  
            try  
              Result:=StartService(b,0,c);  
              CloseServiceHandle(b);  
              CloseServiceHandle(a);  
        except  
              CloseServiceHandle(b);  
    


Ïà¹ØÎĵµ£º

delphi µ÷ÊÔʱ×ܳöÏÖcpu´°¿Ú£¬ntdll.dllµãµÄ½â¾ö·½·¨

 ÔÚÖ÷½çÃæµÄimplementation  {$R *.dfm} Ï·ÅÈëÒÔÏ´úÂ룺
procedure PatchInt3;
var
NOP: Byte;
NTDLL: THandle;
BytesWritten: DWORD;
Address: Pointer;
begin
 if Win32Platform <> VER_PLATFORM_WIN32_NT then
Exit;
 NTDLL := GetModuleHandle('NTDLL.DLL');
 if NT ......

DelphiÖУ¢Á÷£¢µÄÀûÓÃ

ʲôÊÇÁ÷£¿Á÷,¼òµ¥À´Ëµ¾ÍÊǽ¨Á¢ÔÚÃæÏò¶ÔÏó»ù´¡ÉϵÄÒ»ÖÖ³éÏóµÄ´¦ÀíÊý¾Ý
µÄ¹¤¾ß¡£ÔÚÁ÷ÖУ¬¶¨ÒåÁËһЩ´¦ÀíÊý¾ÝµÄ»ù±¾²Ù×÷£¬Èç¶ÁÈ¡Êý¾Ý£¬Ð´ÈëÊý¾ÝµÈ£¬
³ÌÐòÔ±ÊǶÔÁ÷½øÐÐËùÓвÙ×÷µÄ£¬¶ø²»ÓùØÐÄÁ÷µÄÁíһͷÊý¾ÝµÄÕæÕýÁ÷Ïò¡£Á÷²»
µ«¿ÉÒÔ´¦ÀíÎļþ£¬»¹¿ÉÒÔ´¦Àí¶¯Ì¬ÄÚ´æ¡¢ÍøÂçÊý¾ÝµÈ¶àÖÖÊý¾ÝÐÎʽ¡£Èç¹ûÄã¶Ô
Á÷µÄ²Ù×÷·Ç³£ÊìÁ·£¬ÔÚ³ ......

Delphi ShlÓëShr ÒÆÎ»²Ù×÷½éÉÜ

 ¸ñʽ£º²Ù×÷Êý Shl/Shr ÒÆ¶¯Î»Êý
˵Ã÷£º²Ù×÷ÊýÓë·µ»ØÖµ¶¼ÊÇÕûÊý
Àý×Ó£º16(10) = 10000(2)
     16(10) Shr 1 = 10000(2) Shr 1 = 1000(2) = 8(10)
     16(10) Shr 2 = 10000(2) Shr 2 = 100(2) = 4(10)
˵Ã÷£ºÒ»¸öÕûÊý(I)°´Î»×óÒÆÒ»Î»£¬Ï൱ÓÚ°ÑËü³ËÒÔ2£¬¼´ I * 2
&n ......

Using COM+ object pooling with Delphi 6

 URL: http://edn.embarcadero.com/article/27568
Abstract: Delphi 6 introduces support for COM+ object pooling, which can provide significant performance improvements under some circumstances. We take a look at Delphi 6s object pooling support. By Vincent Parrett.
Typically, when a client appl ......

Format¸ñʽ Delphi

Delphi formatµÄÓ÷¨
Ò»¡¢Formatº¯ÊýµÄÓ÷¨
FormatÊÇÒ»¸öºÜ³£Óã¬È´ÓÖËÆºõºÜ·³µÄ·½·¨£¬±¾ÈËÊÔͼ¶ÔÕâ¸ö·½·¨µÄ°ïÖú½øÐÐһЩ·­Ò룬ÈÃËüÓÐÒ»¸öÍêÕûµÄ¸Åò£¬ÒÔ¹©´ó¼Ò²éѯ֮Óãº
Ê×ÏÈ¿´ËüµÄÉùÃ÷£º
function Format(const Format: string; const Args: array of const): string; overload;
ÊÂʵÉÏFormat·½·¨ÓÐÁ½¸öÖÖÐÎʽ£¬Á ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ