Results 1 to 2 of 2

Thread: อยากรู้วิธีอ่านค่า Registry ผ่าน Delphi

  1. #1
    Member
    Join Date
    Mar 2008
    Location
    Gifted Computer S.W.K ChiangRai
    Posts
    30


    อยากรู้วิธีอ่านค่า Registry ผ่าน Delphi ครับ เช่น

    ผมสร้างฟอร์ม มาหนึ่งงอัน .. ใส่ Text ไว้ประมาณ 5 บรรทัด ..

    แล้วสร้าง ปุ่ม มา 1 ปุ่ม เวลากดปุ่มแล้วให้ไปอ่านค่า Registry ครับ

    เช่นผมทำ โปรแกรมหา Pass Winguard โดยให้ Delphi เข้าไปอ่านใน HKEY_LOCAL_MACHINE\SOFTWARE\wgp

    ในนั้นจะมี Key เช้น Pass User CD-Key

    เมื่ออ่านแล้วอยากให้แสดงแทน Text ใน Delphi จะได้ไหมครับ

    เคยลองหลายวิธีแล้วแต่ไม่เคยสำเร็จเลย

    โค๊ดจะประมาณไหนครับ

    edit1.text:={คำสั่งให้อ่า่นค่าใน Registry}KEY_LOCAL_MACHINE\SOFTWARE\wgp

    ท่านใดรู้วิธีช่วยชี้แนะหน่อยครับ
    I'm Gifted Computer SWK.

  2. #2
    Junior Member
    Join Date
    May 2009
    Posts
    2


    uses Registry;


    procedure TForm1.Button1Click(Sender: TObject);
    var
    Reg :TRegIniFile;
    begin
    Reg :=TRegIniFile.Create;
    Reg.RootKey :=KEY_LOCAL_MACHINE;
    if Reg.OpenKey(SOFTWARE\wgp',true) then
    begin
    edit1.text := inttostr(Reg.ReadInteger('Pass&#39);
    // or edit1.text := Reg.ReadString('Pass'
    end;
    reg.CloseKey;

    end;

Similar Threads

  1. Delphi Tip
    By yougubget in forum Delphi,Pascal
    Replies: 0
    Last Post: 28-02-2009, 01:52 PM
  2. Replies: 3
    Last Post: 21-01-2009, 05:11 PM
  3. Replies: 0
    Last Post: 28-12-2008, 12:00 AM
  4. มารู้จักคีย์หลักของ Registry และ ชนิดของข้อมูล Registry
    By DoctorHacker in forum บทความ คอมพิวเตอร์ ทัวไป
    Replies: 0
    Last Post: 18-07-2008, 08:48 PM
  5. Replies: 0
    Last Post: 02-10-2007, 07:46 PM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •