Unit1.cpp
上传用户:lhxd_sz
上传日期:2014-10-02
资源大小:38814k
文件大小:2k
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include <registry.hpp>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- AnsiString ass;
- TRegistry *rg;
- rg=new TRegistry();
- Memo1->Clear();
- rg->RootKey=HKEY_LOCAL_MACHINE;
- rg->OpenKey("\Software\Microsoft\Windows\CurrentVersion",False);
- ass=rg->ReadString("ProductName");
- Memo1->Lines->Add("产品名称:"+ass);
- ass=rg->ReadString("ProductId");
- Memo1->Lines->Add("产品ID:"+ass);
- ass=rg->ReadString("ProductKey");
- Memo1->Lines->Add("产品Key:"+ass);
- ass=rg->ReadString("Version");
- Memo1->Lines->Add("产品版本:"+ass);
- ass=rg->ReadString("RegisteredOrganization");
- Memo1->Lines->Add("注册单位:"+ass);
- ass=rg->ReadString("RegisteredOwner");
- Memo1->Lines->Add("注册个人:"+ass);
- ass=rg->ReadString("SystemRoot");
- Memo1->Lines->Add("系统根目录:"+ass);
- ass=rg->ReadString("DevicePath");
- Memo1->Lines->Add("设备驱动程序目录:"+ass);
- ass=rg->ReadString("ConfigPath");
- Memo1->Lines->Add("配置文件目录:"+ass);
- ass=rg->ReadString("ProgramFilesDir");
- Memo1->Lines->Add("Program Files的目录:"+ass);
- ass=rg->ReadString("CommonFilesDir");
- Memo1->Lines->Add("Common Files的目录:"+ass);
- rg->CloseKey();
- rg->Free();
- }
- //---------------------------------------------------------------------------
-