Solved

How to write and read register ?

Posted on 1998-01-19
2
165 Views
Last Modified: 2010-05-18
I'm making a program that needs to write and read some information to the register.

The information I need to write is the directory were the program is stored and what the name of the database is.

This information must also been read by my program.

How can I do this ?
0
Comment
Question by:CyberChild
2 Comments
 
LVL 2

Accepted Solution

by:
mvz121697 earned 150 total points
ID: 1357027
To read from the registry:
(reads registry value of yyyy in Key xxxx)

    Var
      tReg : TRegistry;
      cDir : String;

    Begin
      tReg := TRegistry.Create;
      With tReg Do
        Begin
          RootKey := HKEY_LOCAL_MACHINE;
         If OpenKey('software\microsoft\windows\currentversion\app\paths\xxxxxx',false)
            Then
              cDir := ReadString('yyyy')
            Else
              cDir:='?????';
          Free
        End;
       End;

To write to registry, use writestring, writeinteger, ....
example:

var
  Registry: TRegistry;
begin
  Registry:=TRegistry.Create;
  with Registry do begin
   RootKey:=HKEY_CURRENT_USER;
  OpenKey('Software\...\..',TRUE);
   WriteString('xxxx','yyyyy');
   CloseKey;
  end;
  Registry.Free;

Greetings,
MvZ
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1357028
Thanks
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Using idhttp to login to instagram 2 89
Delphi selector screen 2 78
TServerSocket - file via sendbuf or Text via sendtext ? 1 53
Delphi and Access based Enumeration 9 61
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question