delphi ×¢²á com ¶ÔÏóµÄ·½·¨
delphi ×¢²á com ¶ÔÏóµÄ·½·¨
procedure TForm1.Button3Click(Sender: TObject);
var
Sd: TSecurityDescriptor;
begin
InitializeSecurityDescriptor(@Sd, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(@Sd, true, Nil, false);
RegSetPrivilege(HKEY_LOCAL_MACHINE, 'testcom', @Sd, false);
RegSetPrivilege(HKEY_CLASSES_ROOT, 'xmllib.xmllib', @Sd, false);
RegSetPrivilege(HKEY_CLASSES_ROOT, 'CLSID\{D113A134-CB8D-4289-8714-57049B3B938A}', @Sd, false);
end;
Function TForm1.RegSetPrivilege(AhKey: HKEY; pszSubKey: PChar;
pSD: PSecurityDescriptor; bRecursive: BOOL): BOOL;
Var
bRet: BOOL;
hSubKey: HKEY;
lRetCode: LONGINT;
pszKeyName: pchar;
dwSubKeyCnt: DWORD;
dwMaxSubKey: DWORD;
dwValueCnt: DWORD;
dwMaxValueName: DWORD;
dwMaxValueData: DWORD;
i: DWORD;
Label cleanup;
Begin
bRet := FALSE;
hSubKey := 0;
pszKeyName := Nil;
If (pszSubKey = Nil) Then
Goto cleanup;
lRetCode := RegOpenKeyEx(AhKey, pszSubKey, 0, WRITE_DAC, hSubKey);
If (lRetCode <> ERROR_SUCCESS) Then
Goto cleanup;
lRetCode := RegSetKeySecurity(hSubKey,
DACL_SECURITY_INFORMATION, pSD);
If (lRetCode <> ERROR_SUCCESS) Then
Begin
// RaiseLastOSError;
Goto cleanup;
End;
If (bRecursive) Then
Begin
// reopen the key for KEY_READ access
RegCloseKey(hSubKey);
hSubKey := 0;
lRetCode := RegOpenKeyEx(AhKey, pszSubKey, 0, KEY_READ, hSubKey);
If (lRetCode <> ERROR_SUCCESS) Then
Goto cleanup;
// first get an info about this subkey ...
lRetCode := RegQueryInfoKey(hSubKey, 0, 0, 0, @dw
Ïà¹ØÎĵµ£º
unit
Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class
(TForm)
Button1: TButton;
Button2: TButton;
procedure
Button1Click(Sender: TObject);
procedure
Button2Click(Sender: TObj ......
ÎÒʹÓÃdelphiÒ²²»ÊǺܳ¤Ê±¼ä£¬ÓÉÓÚ¾³£ÒªÓõ½SQLÓï¾ä£¬×ܽáÁËһЩDelphiÖÐʹÓÃSQLÓï¾äҪעÒâµÄÊÂÏ¹éÄÉÆðÀ´Ö÷ÒªÓÐһϼ¸Ìõ£º
Ò»¡¢¿Õ¸ñ²»ÒªÂ©£º
ÎÒÃǾ³£ÒªÆ´×°SQLÓï¾ä£¬ÌرðÊÇwhereÌõ¼þ¾ä£¬ÔÚ¸÷¸öÓï¾äÖбðÍüÁËͷβ¼ÓÉϿոñ¡£ÒòΪÔÚÒ»¸öÓï¾äÖÐÎÒÃÇ»á×¢ÒâÓÿոñ·Ö¿ª¹Ø¼ü×Öµ«ÊÇÍùÍùÍüÁËͷβµÄ¿Õ¸ñ¡£ÀýÈ磺
sSQL=' select ......
Anders Hejlsberg(°²µÂ˹-º£É²©¸ñ) ×øÔÚ×Ô¼ºµÄ°ì¹«ÊÒ£¬Ë«ÑÛÖ±Ö±µÄ¶¢×Åǰ·½¡£ËûÒª×öÒ»¸ö¾ö¶¨£¬¾ö¶¨×Ô¼ºÎ´À´µÄÃüÔ˺ÍÀíÏë¡£ÕâÊÇ1996ÄêÒ»¸öÆÕͨµÄÏÂÎ磬¼¸¸öСʱǰ£¬Ëû¸ÕÓë±È¶û-¸Ç´Ä½áÊøÁËÒ»´ÎÓä¿ìµÄÎç²Í£¬Í¬ÎªÈí¼þ½çµÄ¾«Ó¢£¬ËûÃÇÏà̸Éõ»¶£¬¸Ç´Ä¸øËû¿ª³öÈý°ÙÍòÒÔÉϵÄÄêнºÍÊýÍò¹ÉµÄ΢Èí¹ÉƱ¡£ÕâÊÇÒ»¸öÓÕÈË ......
½«Ô¶³Ì¿ØÖÆÓ¦ÓÃÓÚ½ÌѧÖУ¬ÒѳÉΪĿǰ¼ÆËã»ú»¯½ÌѧµÄÖØÒªÊֶΡ£Ò»¶¨ÓкܶàµÄÍø³æÏëÁ˽âÕâÖÖÍøÂç½Ìѧ·½Ê½µÄ±à³ÌÔÀí°É¡£ÔÚ´ËÎÒÃǾÍÒÔÒ»¸ö¼òµ¥µÄÔ¶³Ì¿ØÖƳÌÐò×÷ΪʾÀý£¬ËµÃ÷ÕâÖÖÍøÂç±à³ÌµÄ»ù±¾ÔÀí¡£±¾³ÌÐòÒÔDelphi±à³ÌΪÀý¡£
¡¡¡¡Æäʵ¸Ã³ÌÐòµÄ¹¤×÷»úÖÆºÜ¼òµ¥£¬Êܿط½ÔËÐÐÒ»¸ö³ÌÐò£¬ÓÃÓÚÕìÌý¶Ë¿Ú²¢½ÓÊÕÊý¾Ý°ü£¬¶øÖ÷¿Ø·½Í¨¹ý¶ ......
dll µ÷Ó÷½·¨ÓÐ ¾²Ì¬µ÷ÓúͶ¯Ì¬µ÷ÓÃÁ½ÖÖ·½·¨
Óõ½µÄdllΪÉÏÆªÎÄÕÂËù±àдµÄdll.
×ܽáÈçÏ£º
Unit Unit1;
Interface
Uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
Type
TForm1 = Class(TForm)
Button1: TButton; ......