[ Bojann @ 07.01.2006. 17:15 ] @
Potrebno je da pomocu progres bara graficki prikazem koliko je vremena ostalo dok se ne zavrsi skeniranje nekog cd-a ili dvd-a. kAKO CU ZNATI KOLIKO JE VREMENA UOPSTE OSTALO DO KRAJA NEKAKVOG PROCESA? |
[ Bojann @ 07.01.2006. 17:15 ] @
[ Srki_82 @ 07.01.2006. 19:43 ] @
Niko ne moze da ti kaze koliko je vremena ostalo do kraja nekog postupka
![]() Ako sabiras 10 brojeva onda znas da imas deset brojeva i mozes da ispises koliko si ih do sad sabrao, koliko je ostalo, koliko je procenata zavrseno, da, na osnovu vremena koje je trebalo da se saberu brojevi koje si vec obradio, prikazes jos koliko je vremena ostalo i slicno. Ako kopiras fajl... znas da je fajl velicine, recimo, 700Mb... ovde ne sabiras brojeve nego kopiras podatke... ispises koliko si kopirao, koliko je ostalo, koliko je procenata zavrseno, itd... [ Bojann @ 08.01.2006. 18:22 ] @
OK, ali meni je potrebno da procitam sve podatke o fajlovima na cd/dvd-u da bi znao koliko ih ima pa da odredim polozaj na trackbaru, a ja to znam tek kad izbrojim fajlove(koristim findfirts, findnext, findclose), a meni je podatak o broju fajova na cd-u potreban na pocetku samog brojanja.
mozda neko zna neku funkciju koja nam govori broj fajlova na nekom direktorijumu? [ GyG@ @ 08.01.2006. 19:56 ] @
Citat: Bojann: OK, ali meni je potrebno da procitam sve podatke o fajlovima na cd/dvd-u da bi znao koliko ih ima pa da odredim polozaj na trackbaru, a ja to znam tek kad izbrojim fajlove(koristim findfirts, findnext, findclose), a meni je podatak o broju fajova na cd-u potreban na pocetku samog brojanja. mozda neko zna neku funkciju koja nam govori broj fajlova na nekom direktorijumu? Ubaci komponentu TFileListBox i koristi funkciju FileListBox1.Count [ Bojann @ 08.01.2006. 20:31 ] @
Da, ali meni treba da prebrojava i fajlove u subfolderima
[ Srki_82 @ 08.01.2006. 22:49 ] @
Takva funkcija ne postoji. Verovatno si primetio da kad obelezis neki folder sa puno podfoldera i fajlova i uradis copy + paste ili delete explorer kaze "Preparing to Copy/Delete". To je zato sto mora da prodje kroz sve fajlove, da ih izbroji/odredi velicinu pa tek onda pocinje sa kopiranjem/brisanjem da bi mogao da prikaze progress bar.
[ osmica @ 08.01.2006. 23:40 ] @
Ako sam dobro razumeo ti treba da prebrojis fajlove na tom cd-u?
Ako je to,onda malo prepravi onu funkciju sto trazi fajlove po "dubini".Dodaj jednu promenjivu koja ce se povecati svaki put kad se nadje neki fajl. Pozzzz! [ Bojann @ 09.01.2006. 00:54 ] @
pa to sam i uradio, i dobijam ja na kraju procesa kolliko ima fajlova, ali mi tada taj podatak ne znaci puno jer je postupak skeniranja cd-a vec gotov, a meni je potrebno da to znam pre nego sto pocne skeniranje, da bi mogao da odredim koliki je procenat fajlova skeniran
[ Passwd @ 09.01.2006. 09:09 ] @
Kompliciras bezveze..
[ ntojzan @ 09.01.2006. 12:15 ] @
1) pogledas koliko je prostora zauzeto na disku
2) svaki put kada naidjes na file, dodaj velicinu fajla na brojac procenat progresa ti je: 100 * brojac / zauzet prostor [ Bojann @ 09.01.2006. 17:17 ] @
A kko da saznam velicinu diska?
[ osmica @ 09.01.2006. 22:42 ] @
GetDiskFreeSpace
Windows.Pas Syntax GetDiskFreeSpace( lpRootPathName: PChar; {a pointer to the root path string} var lpSectorsPerCluster: DWORD; {the number of sectors per cluster} var lpBytesPerSector: DWORD; {the number of bytes per sector} var lpNumberOfFreeClusters: DWORD; {the number of free clusters} var lpTotalNumberOfClusters: DWORD {the total number of clusters on the drive} ): BOOL; {returns TRUE or FALSE} Description The GetDiskFreeSpace function retrieves information about a drive partition. It returns all the information needed to calculate the available free space for a drive. Note that under Windows 95 prior to service release 2, this function will return incorrect values for volumes bigger than 2 gigabytes in size. Parameters lpRootPathName: A null-terminated string containing the root directory of the drive to query. lpSectorsPerCluster: A variable receiving the number of sectors per cluster for the specified drive. A sector is a collection of bytes, a cluster is a collection of sectors. lpBytesPerSector: A variable receiving the number of bytes in each sector of the drive. lpNumberOfFreeClusters: A variable receiving the number of free clusters on the drive. Drives are used in full cluster increments. Storing a file that is smaller then one cluster will allocate the entire cluster. To get the amount of free drive space in bytes, take the number of free clusters multiplied by the number of sectors per cluster, multiplied by the number of bytes per sector as in the following formula: FreeClusters * SectorsPerCluster * BytesPerSector = Free space in bytes lpTotalNumberOfClusters: A variable receiving the total number of clusters on the drive. To find the total size of the drive in bytes, take the total number of clusters multiplied by the number of sectors per cluster, multiplied by the number of bytes per sector, as in the following formula: TotalNumberOfClusters * SectorsPerCluster * BytesPerSector = Size of drive in bytes Return Value If the function succeeds, it returns TRUE; otherwise it returns FALSE. To get extended error information, call the GetLastError function. Example Listing 14-5: Retrieving the Free Disk Space procedure TForm1.Button1Click(Sender: Tobject); var SectorsPerCluster, // holds the sectors per cluster BytesPerSector, // holds the bytes per sector FreeClusters, // holds the number of free clusters Clusters: DWORD; // holds the total number of disk clusters begin {retrieve the disk space information} if GetDiskFreeSpace('C:\',SectorsPerCluster,BytesPerSector, FreeClusters,Clusters) then begin {display the disk space information} Panel2.Caption := IntToStr(SectorsPerCluster); Panel3.Caption := IntToStr(BytesPerSector); Panel4.Caption := IntToStr(FreeClusters); Panel5.Caption := IntToStr(Clusters); Panel6.Caption := IntToStr(FreeClusters*BytesPerSector*SectorsPerCluster); Panel7.Caption := IntToStr(Clusters*BytesPerSector*SectorsPerCluster); end; end; Snadji se! :) [ Srki_82 @ 09.01.2006. 22:54 ] @
Mislim da mu ne treba nista tako detaljno
![]() Dovoljno ce biti: Code: DiskSize(X); Gde je: X = 0; trenutni disk X = 1; Disk A X = 2; Disk B X = 3; Disk C X = 4; Disk D . . . Ako ti treba slobodan prostor na disku koristi Code: DiskFree(X); X je isto kao i kod DiskSize. P.S. Ovo radi samo na Win platformama. [ osmica @ 10.01.2006. 14:39 ] @
Od viska glava ne boli! :)
Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|