|
-
Nov 11th, 2003, 12:14 PM
#1
Thread Starter
Hyperactive Member
File Copy w/ Progress bar - Why so Slow??? - ALMOST RESOLVED
ok, im trying to do a filecopy progress bar, it copies the file fine, but it is SOOOOOOOOO slow while copying the file, and once the file is done copying it takes about 30 seconds to release the files
Any suggestions?
The form has 2 text boxes, one frame, one progressbar, and the command button
VB Code:
Private Sub Command1_Click()
Dim MyBytesa As Byte
Dim MyBytesb As Byte
Dim counter As Integer
Source = "C:\test.zip"
Dest = "c:\testfolder\test.zip"
Open Source For Binary As #1
Open Dest For Binary As #2
ProgressBar1.Max = FileLen(Source) / 1024
Text1.Text = FileLen(Source)
Do Until EOF(1)
counter = 0
MyBytesa = Empty
MyBytesb = Empty
Do Until (EOF(1)) Or (counter = 100)
Get #1, , MyBytesa
Put #2, , MyBytesa
counter = counter + 1
Loop
Text2.Text = FileLen(Dest)
ProgressBar1.Value = Text2.Text / 1024
DoEvents
Loop
Close #1
Close #2
Frame1.Caption = "Update Progress - Done!"
ProgressBar1.Value = ProgressBar1.Max
End Sub
Last edited by Ogmius; Nov 12th, 2003 at 06:15 PM.
"I dont even see the code anymore... I just see Blonde, Brunette, Redhead..."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|