Click here to Skip to main content
15,891,607 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Combobox 2 ListView Pin
Wayne Gaylard12-Sep-11 3:04
professionalWayne Gaylard12-Sep-11 3:04 
GeneralRe: Combobox 2 ListView Pin
Lek Plepi12-Sep-11 3:14
Lek Plepi12-Sep-11 3:14 
GeneralRe: Combobox 2 ListView Pin
Wayne Gaylard12-Sep-11 3:23
professionalWayne Gaylard12-Sep-11 3:23 
GeneralRe: Combobox 2 ListView Pin
Lek Plepi12-Sep-11 3:41
Lek Plepi12-Sep-11 3:41 
GeneralRe: Combobox 2 ListView Pin
Wayne Gaylard12-Sep-11 3:47
professionalWayne Gaylard12-Sep-11 3:47 
AnswerRe: Combobox 2 ListView Pin
MicroVirus12-Sep-11 3:05
MicroVirus12-Sep-11 3:05 
GeneralRe: Combobox 2 ListView Pin
Lek Plepi12-Sep-11 3:47
Lek Plepi12-Sep-11 3:47 
QuestionAdding progress bar for CRC32 checksum Pin
johnjsm9-Sep-11 11:07
johnjsm9-Sep-11 11:07 
Hi,
I have a public function that generates a CRC32 checksum of a file. What I am looking to add to it is a progress bar that progresses as the checksum is created.

CRC32 Function

VB
Public Function GetCrc32(ByRef stream As System.IO.Stream) As Integer

        Dim crc32Result As Integer
        crc32Result = &HFFFFFFFF

        Dim buffer(BUFFER_SIZE) As Byte
        Dim readSize As Integer = BUFFER_SIZE

        Dim count As Integer = stream.Read(buffer, 0, readSize)
        Dim i As Integer
        Dim iLookup As Integer
        Dim tot As Integer = 0
        Do While (count > 0)
            For i = 0 To count - 1
                iLookup = (crc32Result And &HFF) Xor buffer(i)
                crc32Result = ((crc32Result And &HFFFFFF00) \ &H100) And &HFFFFFF   ' nasty shr 8 with vb :/
                crc32Result = crc32Result Xor crc32Table(iLookup)
            Next i
            count = stream.Read(buffer, 0, readSize)
        Loop

        GetCrc32 = Not (crc32Result)

    End Function


the function is then called when I click on a button

VB
Dim f As FileStream = New FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
                crc = c32.GetCrc32(f)
                lblCRC32.Text = Hex(crc)


How do I add a progress bar to work with the function and display the actual progress.

Thanks
J
AnswerRe: Adding progress bar for CRC32 checksum Pin
MicroVirus9-Sep-11 13:25
MicroVirus9-Sep-11 13:25 
GeneralRe: Adding progress bar for CRC32 checksum Pin
johnjsm10-Sep-11 10:34
johnjsm10-Sep-11 10:34 
AnswerRe: Adding progress bar for CRC32 checksum Pin
DaveAuld10-Sep-11 11:24
professionalDaveAuld10-Sep-11 11:24 
AnswerRe: Adding progress bar for CRC32 checksum Pin
MicroVirus10-Sep-11 11:47
MicroVirus10-Sep-11 11:47 
GeneralRe: Adding progress bar for CRC32 checksum Pin
johnjsm10-Sep-11 12:01
johnjsm10-Sep-11 12:01 
QuestionVB and MDB Pin
hansoctantan8-Sep-11 1:16
professionalhansoctantan8-Sep-11 1:16 
AnswerRe: VB and MDB Pin
Wayne Gaylard8-Sep-11 1:27
professionalWayne Gaylard8-Sep-11 1:27 
GeneralRe: VB and MDB Pin
hansoctantan8-Sep-11 3:51
professionalhansoctantan8-Sep-11 3:51 
GeneralRe: VB and MDB Pin
Wayne Gaylard8-Sep-11 4:01
professionalWayne Gaylard8-Sep-11 4:01 
GeneralRe: VB and MDB Pin
hansoctantan8-Sep-11 5:46
professionalhansoctantan8-Sep-11 5:46 
GeneralRe: VB and MDB Pin
Simon_Whale8-Sep-11 6:24
Simon_Whale8-Sep-11 6:24 
AnswerRe: VB and MDB Pin
Luc Pattyn8-Sep-11 4:34
sitebuilderLuc Pattyn8-Sep-11 4:34 
AnswerRe: VB and MDB Pin
Eddy Vluggen8-Sep-11 6:57
professionalEddy Vluggen8-Sep-11 6:57 
QuestionRestore failed for Server '...\SQLEXPRESS' Pin
C#Coudou7-Sep-11 23:41
C#Coudou7-Sep-11 23:41 
AnswerRe: Restore failed for Server '...\SQLEXPRESS' Pin
Pradeep Shukla8-Sep-11 7:42
professionalPradeep Shukla8-Sep-11 7:42 
GeneralRe: Restore failed for Server '...\SQLEXPRESS' Pin
C#Coudou8-Sep-11 13:45
C#Coudou8-Sep-11 13:45 
AnswerRe: Restore failed for Server '...\SQLEXPRESS' Pin
Eddy Vluggen8-Sep-11 9:59
professionalEddy Vluggen8-Sep-11 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.