Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy process with OLE ProgressBar
Message
De
23/03/1998 09:49:02
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
23/03/1998 09:16:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00086355
Message ID:
00086368
Vues:
40
>I am using in a program the 'copy file' command to copy files . I would like to use the OLE ProgressBar to show the progress of the copying process . I want to ask you to show me a way to do this .Thank You !
With "copy file" you would need more than one file to copy to show progressbar. So you could show percentage as filescopied*100/totalfilestocopy.
*Suppose you have a ProgressBar control as olecontrol1
thisform.olecontrol1.value = recno()*100/reccount() && Update thermometer
To do it for just one file, you should do copy with lowlevel, so show bytescopied*100/Totalbytes.
h1=fopen(cFileToCopy)
h2=fcreate(cNewFile)
nFileSize = fseek(h1,0,2)
=fseek(h1,0)
n=0
do while !feof(h1)
   =fwrite(h2,fread(h1,65535))
   n=n+1
   thisform.progbar.value = (min(n*65535*100,nFileSize)/nFileSize)
enddo
=fclose(h2)
=fclose(h1)
cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform