全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:2154
推到 Plurk!
推到 Facebook!

delphi 封裝之win api可知機碼之建立時間,但如何得知機碼所含之值之建立時間

答題得分者是:cmf
ry_lee
高階會員


發表:368
回覆:251
積分:123
註冊:2002-03-19

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-02-03 18:00:20 IP:61.59.xxx.xxx 未訂閱
1.delphi封裝很多win reg api,其中有幾個函數可得知機碼之建 立時間,但似乎無法得知機碼所含之值項目名稱之建立時間或修 改時間,請問有誰知道delphi的那個function可以得知機碼所含 之值項目名稱之建立時間或修改時間? 2.請問有誰知道delphi的那個function可以得知機碼及機碼所含 之值項目名稱是無效可安全刪除? 3.在呼叫regsavekey(delphi封裝win reg api)前,似乎要取得一 些權利,否則呼叫會失敗,請問有誰知道在呼叫regsavekey前要怎 麼做?
ry_lee
高階會員


發表:368
回覆:251
積分:123
註冊:2002-03-19

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-02-04 15:10:34 IP:61.59.xxx.xxx 未訂閱
引言:

TRegistry

Registry is a low-level wrapper for the system registry and functions that operate on the registry. Unit registry Description Use TRegistry to encapsulate access to the Windows system registry in an application. The registry is a database that an application can use to store and retrieve configuration information. Configuration information is stored in a hierarchical tree. Each node in the tree is called a key. Every key can contain subkeys and data values that represent part of the configuration information for an application. All keys that an application creates, opens, reads, or writes are subkeys of predefined root keys. By default, a TRegistry object is created with a root key of HKEY_CURRENT_USER. Only one key is accessible at a time in a TRegistry object. To determine the key that is currently accessible, read the value of the CurrentKey property. TRegistry methods enable an application to open, close, save, move, copy, and delete keys. One or more data values containing actual configuration information can be stored in a key. TRegistry methods enable an application to query a key to see if it contains data, to read data in a key, and to write data to a key. In TRegistry property Access: LongWord; property CurrentKey: HKEY; property CurrentPath: String; property LazyWrite: Boolean; property RootKey: HKEY; FUNCTIONS: CloseKey Create CreateKey DeleteKey DeleteValue Destroy GetDataInfo GetDataSize GetDataType GetKeyInfo GetKeyNames GetValueNames HasSubKeys KeyExists LoadKey MoveKey OpenKey OpenKeyReadOnly ReadBinaryData ReadBool ReadCurrency ReadDate ReadDateTime ReadFloat ReadInteger ReadString ReadTime RegistryConnect RenameValue ReplaceKey RestoreKey SaveKey UnLoadKey ValueExists WriteBinaryData WriteBool WriteCurrency WriteDate WriteDateTime WriteExpandString WriteFloat WriteInteger WriteString WriteTime
謝謝你的回覆: 1.但以上function和property似乎在win api已有提供類似之功能,我猜delphi只是封裝win api或稍為修改,我的意思是用win api也一樣可達成同樣目的,是不是 ? 2.如何可以得知機碼或機碼所含之值項目名稱或資料值是無效可安全刪除? 3.如何可以得知機碼所含之值項目名稱之建立時間或修改時間?
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-02-04 15:48:29 IP:61.70.xxx.xxx 未訂閱

Registry Functions

Following are the functions used with the registry: RegCloseKey RegConnectRegistry RegCreateKey RegCreateKeyEx RegDeleteKey RegDeleteValue RegEnumKey RegEnumKeyEx RegEnumValue RegFlushKey RegGetKeySecurity RegLoadKey RegNotifyChangeKeyValue RegOpenKey RegOpenKeyEx RegQueryInfoKey RegQueryMultipleValues RegQueryValue RegQueryValueEx RegReplaceKey RegRestoreKey RegSaveKey RegSetKeySecurity RegSetValue RegSetValueEx RegUnLoadKey 發表人 - cmf 於 2003/02/12 00:19:14
------
︿︿
ry_lee
高階會員


發表:368
回覆:251
積分:123
註冊:2002-03-19

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-02-12 20:35:37 IP:61.59.xxx.xxx 未訂閱
引言:

Registry Functions

Following are the functions used with the registry: RegCloseKey RegConnectRegistry RegCreateKey RegCreateKeyEx RegDeleteKey RegDeleteValue RegEnumKey RegEnumKeyEx RegEnumValue RegFlushKey RegGetKeySecurity RegLoadKey RegNotifyChangeKeyValue RegOpenKey RegOpenKeyEx RegQueryInfoKey RegQueryMultipleValues RegQueryValue RegQueryValueEx RegReplaceKey RegRestoreKey RegSaveKey RegSetKeySecurity RegSetValue RegSetValueEx RegUnLoadKey 發表人 - cmf 於 2003/02/12 00:19:14
我試用TRrgistri物件之方法savekey但似乎無法有效將指定之key存成檔案,我試用結果是產生一個0byte之指定檔名之檔案,不曉得你測試之結果如何?
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-02-12 23:16:48 IP:61.70.xxx.xxx 未訂閱
ry_lee:      我試出來了      unit Unit1;    interface    uses   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,registry;    type   TForm1 = class(TForm)     procedure FormClick(Sender: TObject);   private     { Private declarations }   public     { Public declarations }   end;    var   Form1: TForm1;    implementation    {$R *.DFM}    procedure TForm1.FormClick(Sender: TObject);    var   Reg: TRegistry; begin   Reg := TRegistry.Create( KEY_ALL_ACCESS);   try    Reg.RootKey := HKEY_CURRENT_USER;    if  reg.SaveKey('\Software\Microsoft\Windows\','c:\a.reg') then    begin      showmessage('SAVE OK');    end    else    begin       showmessage('SAVE ERROR');    end;          finally     Reg.Free;   end;    end;    end.         發表人 - cmf 於 2003/02/13 09:30:56
------
︿︿
ry_lee
高階會員


發表:368
回覆:251
積分:123
註冊:2002-03-19

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-02-17 01:48:11 IP:61.59.xxx.xxx 未訂閱
引言: ry_lee: 我試出來了 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,registry; type TForm1 = class(TForm) procedure FormClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.FormClick(Sender: TObject); var Reg: TRegistry; begin Reg := TRegistry.Create( KEY_ALL_ACCESS); try Reg.RootKey := HKEY_CURRENT_USER; if reg.SaveKey('\Software\Microsoft\Windows\','c:\a.reg') then begin showmessage('SAVE OK'); end else begin showmessage('SAVE ERROR'); end; finally Reg.Free; end; end; end. 發表人 - cmf 於 2003/02/13 09:30:56
我之前寫的程式內容與上述大同小異,試驗結果失敗,照上述程式內容試驗結果亦失敗,我實在不知原因何在,不過還是謝謝你的指教
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-02-17 01:59:47 IP:61.70.xxx.xxx 未訂閱
R SIR:    請 Recheck 這 一行 Reg := TRegistry.Create( KEY_ALL_ACCESS);    
------
︿︿
soni
一般會員


發表:17
回覆:29
積分:9
註冊:2003-02-06

發送簡訊給我
#8 引用回覆 回覆 發表時間:2003-02-17 15:01:48 IP:61.219.xxx.xxx 未訂閱
引言: R SIR: 請 Recheck 這 一行 Reg := TRegistry.Create( KEY_ALL_ACCESS);
cmf大大你好 這段程式碼小弟我也試ㄌ一下可還是不行ㄋ 不知道是否delphi4的做法不一樣ㄋ可否請教大大 delphi4的做法ㄋ 3q 小弟用delphi4測試上面那段程式碼 錯誤訊息如下 too many actual parameters 錯誤是出現在 Reg := TRegistry.Create( KEY_ALL_ACCESS); 這行 可否請教大大這是怎麼回事ㄋ?? 謝
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#9 引用回覆 回覆 發表時間:2003-02-17 15:09:13 IP:61.218.xxx.xxx 未訂閱
S SIR:    俺 沒有 d4 所以 俺也不知 KEY_ALL_ACCESS 在d4 叫什麼 parameter        
------
︿︿
系統時間:2024-04-29 2:30:06
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!