Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Progress Bar Freezing
Message
 
To
21/06/2005 09:53:00
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01024815
Message ID:
01025164
Views:
13
Paul,
Yes I think you have to create a new process for the progress bar (I belive the CodeProject article did that). I am not fluent in VB.NET, but I will try to go through your code later today (if time permits).

Einar

>Hi Einar,
>
>I will check out the progress bar you mentioned, in the meantime here is one of the subs that updates the progress bar. There is another one a bit later on but basically the same thing. If the form loses focus it just looks stuck but the code will complete. I think maybe i need to look into multi threading?
>
>
> Private Sub recurse(ByVal dir As String, ByRef strmZipOutputStream As ZipOutputStream)
>        Dim Add, Current As Integer
>        Dim ChildDirs, childfiles As String()
>        Dim Cdir, cfile As String
>
>
>        ChildDirs = Directory.GetDirectories(dir)
>
>        For Each Cdir In ChildDirs
>            childfiles = Directory.GetFiles(Cdir, ds.Tables("fileconfig").Rows(0).Item("filemask"))
>            Dim objCrc32 As New Crc32
>            Me.ProgressBar1.Minimum = 0
>            Me.ProgressBar1.Step = 1
>            Me.ProgressBar1.Maximum = childfiles.Length
>            '
>            For Each cfile In childfiles
>
>                Me.lblprogress.Text = "Compressing " & cfile
>                Me.lblprogress.Refresh()
>                Dim strmFile As FileStream = File.OpenRead(cfile)
>                Dim abyBuffer(strmFile.Length - 1) As Byte
>                strmFile.Read(abyBuffer, 0, abyBuffer.Length)
>                Dim objZipEntry As ZipEntry = New ZipEntry(cfile)
>                objZipEntry.DateTime = DateTime.Now
>                objZipEntry.Size = strmFile.Length
>                strmFile.Close()
>                objCrc32.Reset()
>                objCrc32.Update(abyBuffer)
>                objZipEntry.Crc = objCrc32.Value
>                strmZipOutputStream.PutNextEntry(objZipEntry)
>                strmZipOutputStream.Write(abyBuffer, 0, abyBuffer.Length)
>                Me.ProgressBar1.PerformStep()
>
>            Next
>            Me.ProgressBar1.Value = 0
>            'Keep going
>            recurse(Cdir, strmZipOutputStream)
>
>        Next
>
>    End Function
>
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform