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);
Ïà¹ØÎĵµ£º
ÔÚÖ÷½çÃæµÄ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 ......
ʲôÊÇÁ÷£¿Á÷,¼òµ¥À´Ëµ¾ÍÊǽ¨Á¢ÔÚÃæÏò¶ÔÏó»ù´¡ÉϵÄÒ»ÖÖ³éÏóµÄ´¦ÀíÊý¾Ý
µÄ¹¤¾ß¡£ÔÚÁ÷ÖУ¬¶¨ÒåÁËһЩ´¦ÀíÊý¾ÝµÄ»ù±¾²Ù×÷£¬Èç¶ÁÈ¡Êý¾Ý£¬Ð´ÈëÊý¾ÝµÈ£¬
³ÌÐòÔ±ÊǶÔÁ÷½øÐÐËùÓвÙ×÷µÄ£¬¶ø²»ÓùØÐÄÁ÷µÄÁíһͷÊý¾ÝµÄÕæÕýÁ÷Ïò¡£Á÷²»
µ«¿ÉÒÔ´¦ÀíÎļþ£¬»¹¿ÉÒÔ´¦Àí¶¯Ì¬ÄÚ´æ¡¢ÍøÂçÊý¾ÝµÈ¶àÖÖÊý¾ÝÐÎʽ¡£Èç¹ûÄã¶Ô
Á÷µÄ²Ù×÷·Ç³£ÊìÁ·£¬ÔÚ³ ......
¸ñʽ£º²Ù×÷Êý 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 ......
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 ......
Delphi formatµÄÓ÷¨
Ò»¡¢Formatº¯ÊýµÄÓ÷¨
FormatÊÇÒ»¸öºÜ³£Óã¬È´ÓÖËÆºõºÜ·³µÄ·½·¨£¬±¾ÈËÊÔͼ¶ÔÕâ¸ö·½·¨µÄ°ïÖú½øÐÐһЩ·Ò룬ÈÃËüÓÐÒ»¸öÍêÕûµÄ¸Åò£¬ÒÔ¹©´ó¼Ò²éѯ֮Óãº
Ê×ÏÈ¿´ËüµÄÉùÃ÷£º
function Format(const Format: string; const Args: array of const): string; overload;
ÊÂʵÉÏFormat·½·¨ÓÐÁ½¸öÖÖÐÎʽ£¬Á ......