Autor Beitrag
littlemike1005
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 187



BeitragVerfasst: So 24.11.02 14:55 
Wie lese ich die Regestry aus? Ich habe eine CNC – Fräsprogramm für eine CNC Fräse für das ich ein Werkzeugarchiv schreibe. Mein Programm muss aber wissen wo sich die Werkzeugdatei von TwinCam befindet. Der Pfad von TwinCam steht in der Regestry.

HKEY_CURRENT_USER\Software\borland\IP Team\TwinCAM\72622

Name: TCPath
Typ:REG_SZ
Wert:c:\programme\twincam

Wie kann ich die Regestry auslesen so das ich an den wert von TCPath komme.

Gut ich könnte auch die Festplatten durchsuchen aber das dauert zu lange.


Danke.
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: So 24.11.02 15:22 
guckst du hier :)

_________________
Viele Grüße
Jakob
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: So 24.11.02 15:23 
Hi, so kannst du den Wert auslesen :

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
function ReadFromRegistry: String;
var                                                                             
  Registry : TRegistry;                                                  
begin                                                                          
  Registry := TRegistry.Create;             
  Registry.RootKey := HKEY_CURRENT_USER;                       
  if Registry.KeyExists('\Software\borland\IP Team\TwinCAM\72662') = true then begin       
    if Registry.OpenKey('\Software\borland\IP Team\TwinCAM\72662', true) = true then               
      result := Registry.ReadString('TCPath')  
    else                                                 
      result := 'Keinen Eintrag gefunden';       
    end                                                  
  else                                                    
    result := 'Den Schlüssel nicht gefunden';          
    Registry.Free;                                    
end;


Abrufen des Wertes :

ausblenden Quelltext
1:
Label1.Caption := ReadFromRegistry;					
littlemike1005 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 187



BeitragVerfasst: So 24.11.02 15:35 
Titel: DANKE
:lol: DANKE @ALL das ist die lösung für mein Problem



Hallo bis11 hast Du schon angefangen bezügl. der Komponenten?

Gruss. littlemike