Autor Beitrag
rafi@work
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Di 01.07.03 10:59 
Hallo!

Dies ist mein ini-file. Diese Daten habe ich von einer ListView gelesen und im ini abgespeichert. Nun möchte ich diese Daten wieder in di ListView abfüllen, wie mache ich das? :?

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
[Device1]
DeviceName=DeviceView1
Property1=Ready
Property2=AD
Property3=172.16.50.9/1232
Property4=15
Property5=1
Property6=1
[Device2]
DeviceName=Geko1
Property1=Ready
Property2=SCI
Property3=172.16.100.30/1486
Property4=1
Property5=1
Property6=7
[Device3]
DeviceName=BS_IVR
Property1=Active
Property2=VRU
Property3=127.0.0.1/1487
Property4=2
Property5=1
Property6=196864
[Device4]
DeviceName=BS_IVRB
Property1=Active
Property2=VRUB
Property3=127.0.0.1/1488
Property4=3
Property5=1
Property6=196864


Moderiert von user profile iconKlabautermann: Code-Tags hinzugefügt.
Moderiert von user profile iconTino: Titel geändert & Topic verschoben
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Di 01.07.03 11:12 
guden
such ma nach
ini.readsections

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Di 01.07.03 13:40 
foxy danke für deine Hilfe!
ich habe das problem nun wie folgt gelöst:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
Procedure TSocketConnectForm.ReadFromIni();
var
  i, p : Integer;
  SectionNotFound : Boolean;
  SectionList : TStringList;
  ListItem : TListItem;
begin
  SectionList := TStringList.create;
  SectionList.Clear;
  SectionNotFound := false;
  i := 1;
  while SectionNotFound = false do
  begin
    FDeviceIniFile.ReadSection('Device'+IntToStr(i),SectionList);
    if SectionList.Count > 0 then
    begin
      ListItem := self.ListViewDevice.Items.Add();
      ListItem.Caption := FDeviceIniFile.ReadString('Device'+IntToStr(i),SectionList[0],'dev'+IntToStr(i));
      for p := 1 to SectionList.Count-1 do
      begin
        ListItem.SubItems.Add(
        FDeviceIniFile.ReadString('Device'+IntToStr(i),SectionList[p],'prop'+IntToStr(i)));
      end;
    end
    else SectionNotFound := true;
    inc(i);
  end;
end;



Moderiert von user profile icontommie-lie: Code- durch Delphi-Tags ersetzt
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Di 01.07.03 14:15 
ja wenns geht ist wunderbar :)

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)