SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old October 27th, 2004, 10:29 AM
stevenoc stevenoc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 11 stevenoc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
File transfer progress bar

I am trying to create a progress bar for a file transfer using the FSO but I am not having any luck. I've got the progress bar ok and I understand how it works. What i am having trouble with is incrementing the bar in relation to size of the file and the amount of data transfered.
Any help would be greatly appreciated.

Reply With Quote
  #2  
Old October 29th, 2004, 08:46 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 4
Cool

This may help

AvanceInit is where the process message is initializated
AvanceHide is for hidding the progress message
AvanceProgress is for showing the progress

Need global variables: Avance_Count and Avance_Percent as long

note: You have to track the transfer progress (By Bytes and Know the filesize <no need to be exact, you can call the hide procedure at the end with no matter of the counter>)

Sub AvanceInit(Description As String, TITLE As String, Optional ByVal TOTAL As Long = 0)
Avance_Count = 0: Avance_Percent = 0: Avance_Total = TOTAL
Avance.Descripcion = Description
Avance.Caption = TITLE
If TOTAL <> 0 Then Avance.AvanceBar.Value = 0
Avance.AvanceBar.Visible = TOTAL <> 0
Avance.SHOW
Avance.Refresh
DoEvents
End Sub
Sub AvanceHide()
Avance.Hide
End Sub

Sub AvanceProgress()
Dim i As Long
i = CLng(Avance_Count / Avance_Total * 10) * 10
If i > Avance_Percent And i < 100 Then
Avance.AvanceBar.Value = i
DoEvents
Avance_Percent = i
End If
Avance_Count = Avance_Count + 1
End Sub

Reply With Quote
  #3  
Old November 3rd, 2004, 05:40 PM
stevenoc stevenoc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 11 stevenoc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It is the tracking of the transfer progress that I am having trouble with. I have used the code below and it works alright but the problem is that it takes an extordinarly long time to process. A 1mb file that usually takes 0.45 seconds on my machine now takes more that 25 seconds with this method. I can only seem to transfer one byte at a time. Is there a way of increasing this or is there a better way?

Dim aByte As Byte
Dim File1 As Integer
Dim File2 As Integer
File1 = FreeFile
Open Source For Binary As #File1
File2 = FreeFile
Open Target For Binary As #File2
Do While Not LOF(File1) < Seek(File1)
Get #File1, , aByte
Put #File2, , aByte
'Refresh the progressbar after every 98304 bytes transfered.
If Loc(File1) / 98304 = CInt(Loc(File1) / 98304) Then
'Update progress bar
End If
Loop

Thanks Steven

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > File transfer progress bar


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway