Registry

xiaoxiao2021-03-06  93

VAR

REG: TREGISTRY;

Begin

REG: = Tregistry.create;

Reg.rootkey: = HKEY_CURRENT_USER;

If not reg.keyexists ('/ Software / TT / TT') THEN / / Decision has a primary key;

Begin

/ / Here is the program that does not have to do

END;

REG.CLOSEKEY;

Reg.free;

Determine whether the value exists

IF notreg.valueexists ('user') THEN

Begin

Reg.writeInteger ('user', strthannel);

END;

REG.CLOSEKEY;

Reg.free;

A list of the probation period using the registry to join the program.

Unit unit1;

Interface

Uses

Windows, Messages, Sysutils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, stdctrls, registry;

Type

TFORM1 = Class (TFORM)

EDIT1: TEDIT;

EDIT2: TEDIT;

EDIT3: TEDIT;

EDIT4: TEDIT;

Procedure formactivate (Sender: TOBJECT);

Private

{Private Declarations}

public

{Public declarations}

END;

VAR

FORM1: TFORM1;

IMPLEMENTATION

{$ R * .dfm}

Procedure TFORM1.MMACACTIVATE (Sender: TOBJECT);

Var REG: TREGISTRY; Const a = 10;

Begin

REG: = Tregistry.create;

IF not reg.keyexists ('DDD / DDD') THEN

Begin

Reg.createKey ('DDD / DDD');

END;

Reg.openkey ('DDD / DDD', TRUE);

IF notreg.valueexists ('aaa') THEN

Begin

Reg.writeString ('aaa', '0');

END;

Edit1.text: = reg.readstring ('aaa');

Edit3.Text: = INTTOSTR (STRTOINT (Edit1.Text) STRTOINT (Edit2.Text));

Reg.writeString ('aaa', '' edit3.text '');

REG.CLOSEKEY;

IF a

ShowMessage ('DDDDDDD');

END;

End.

转载请注明原文地址:https://www.9cbs.com/read-122241.html

New Post(0)