Results 1 to 21 of 21

Thread: File Copy w/ Progress bar - Why so Slow??? - ALMOST RESOLVED

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Location
    Manchester, CT
    Posts
    317

    Question 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:
    1. Private Sub Command1_Click()
    2. Dim MyBytesa As Byte
    3. Dim MyBytesb As Byte
    4. Dim counter As Integer
    5.  
    6. Source = "C:\test.zip"
    7. Dest = "c:\testfolder\test.zip"
    8.  
    9. Open Source For Binary As #1
    10. Open Dest For Binary As #2
    11.    
    12. ProgressBar1.Max = FileLen(Source) / 1024
    13.  
    14. Text1.Text = FileLen(Source)
    15.  
    16. Do Until EOF(1)
    17.     counter = 0
    18.     MyBytesa = Empty
    19.     MyBytesb = Empty
    20.     Do Until (EOF(1)) Or (counter = 100)
    21.         Get #1, , MyBytesa
    22.         Put #2, , MyBytesa
    23.         counter = counter + 1
    24.     Loop
    25.     Text2.Text = FileLen(Dest)
    26.     ProgressBar1.Value = Text2.Text / 1024
    27.     DoEvents
    28. Loop
    29.  
    30. Close #1
    31. Close #2
    32. Frame1.Caption = "Update Progress - Done!"
    33. ProgressBar1.Value = ProgressBar1.Max
    34.  
    35. 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
  •  



Click Here to Expand Forum to Full Width