[ sojic @ 01.12.2006. 15:27 ] @
Trebam da zapamtim array od dve polja: Account[1] = [user, password]; Account[2] = [user, password]; Account[3] = [user, password]; Kako da zapamtim ovo u nekom fajlu (.ini na primer)? |
[ sojic @ 01.12.2006. 15:27 ] @
[ savkic @ 01.12.2006. 17:21 ] @
> Trebam da zapamtim array od dve polja:
> Account[1] = [user, password]; > Account[2] = [user, password]; > Account[3] = [user, password]; Ne postoji gotova procedura za snimanje nizova u fajl, moraš sam osmisliti format i uraditi snimanje evo recimo mogućeg načina: Code: var a: TStringList; i: Integer; begin a := TStringList.Create; try for i := 0 to 2 do a.Add(Account[i, 0] + #9 + Account[i, 1]); a.SaveToFile('C:\Proba.txt'); finally a.Free; end; end; [ Srdjan_exe @ 01.12.2006. 19:13 ] @
Evo ti bas sa inijem... ... Uses IniFiles, ... Procedure BlaBla; var ini : TIniFile i : integer; begin ini:=TIniFile.Create('imeFajla.ini'); for i:=1 to 3 do ini.WriteString(('Account' + IntToStr(i)), 'User, Password = ', (User(i) + ', ' + Pass(i))); ini.free; end; (Ovo predpostavlja da u User(i) i Pass(i) imas neke Korisnike i Lozinke kao stringove) Dakle, User i Pass su varijable tipa string koje imaju svoje vrednosti) Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|