讀取登錄檔(delphi)

2021-04-18 14:41:31 字數 1574 閱讀 3496

function readreg(xbf:widestring):widestring; var   xbfconnect:string;   xbfconn1,regconn2,xbfconn3:string;   tempregbin:array [0..15]of char;   xbflen:integer;   h1:thandle;   //   p : pchar;   err : dword;   errstr:string;   year,month,day,dow:word;   daystr,monthstr:string;   nowdate:string;   installdate:string;   timelag:integer;   //2007.1.6定位密碼位置   pwdcoordinate:integer; begin   myreg:=tregistry.create;   with myreg.create do   begin     myreg.rootkey:=hkey_local_machine;

//內嵌過程 start     //內嵌過程stop

if valueexists('support1')then     begin       myreg.readbinarydata('support1',tempregbin,4);       childstr1:= tempregbin     end     else     begin       installbool:=true;       exit;     end;

if valueexists('support2')then     begin       myreg.readbinarydata('support2',tempregbin,16);       childstr2:= tempregbin      end      else      begin        installbool:=true;        exit;      end;

if valueexists('support3')then      begin        myreg.readbinarydata('support3',tempregbin,16);        childstr3:= tempregbin      end      else      begin        installbool:=true;        exit;      end;

if valueexists('support4')then      begin        myreg.readbinarydata('support4',tempregbin,8);        childstr4:= tempregbin      end      else      begin        installbool:=true;        exit;      end;

if valueexists('support5')then      begin        myreg.readbinarydata('support5',tempregbin,8);        childstr5:= tempregbin      end      else      begin        installbool:=true;        exit;      end;

delphi 遍歷登錄檔

下面程式是讀出windows中所有的已安裝的程式.你自己看一下,很容易的.uses registry procedure tform1.button1click sender tobject var list,softlist tstringlist reg tregistry fpath,fkey...

Delphi中讀寫登錄檔

delphi程式中入如何操作登錄檔,在應用程式中,經常需要對登錄檔進行各種操作,如將程式名稱 安裝路徑等資訊儲存到登錄檔中。32位delphi程式中可利用tregistry物件來訪問登錄檔檔案中的資訊。一 建立和釋放tregistry物件 1.建立tregistry物件。為了操作登錄檔,要建立乙個t...

C 登錄檔讀取函式

string cconvert getregstr string name,char base 得到name的字串值s,result必須先初始化 dword dwcount 255 regqueryvalueex hresult,name.c str 0,0,byte result 0 dwcoun...