[View Borland Home Page][View Product List][Search This Web Site][View Available Downloads][Join Borland Online][Enter Discussion Area][Send Email To Webmaster]
Delphi Devsupport

Frequently Asked Questions

Getting user name and company info from Windows.

Question:

How do I retrieve the user name and company information from
Windows?

Answer:

This information is stored under the "HKEY\CURRENT USER" section
of the Windows registry. The task of retrieving this entry is greatly
simplified by using the TRegIniFile component.

Example:

uses Registry;

procedure TForm1.Button1Click(Sender: TObject);
var
  reg: TRegIniFile;
begin
  reg := TRegIniFile.create('SOFTWARE\MICROSOFT\MS SETUP (ACME)\');
  Memo1.Lines.Add(reg.ReadString('USER INFO',
                                 'DefName',
                                 'Frank Borland'));
  Memo1.Lines.Add(reg.ReadString('USER INFO',
                                 'DefCompany',
                                 'A Valued Borland Customer'));
  reg.free;
end;

Back To Faq Index
Borland Online
Trademarks & Copyright © 1997 Borland International, Inc.