Click here to Skip to main content
15,914,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Left$, Right$, Trim$, "$" Advice. Pin
Clark Kent12315-Sep-11 2:18
professionalClark Kent12315-Sep-11 2:18 
AnswerRe: Left$, Right$, Trim$, "$" Advice. Pin
MicroVirus15-Sep-11 4:25
MicroVirus15-Sep-11 4:25 
QuestionStored Proedure Pin
megasoft house14-Sep-11 1:18
megasoft house14-Sep-11 1:18 
AnswerRe: Stored Proedure Pin
ekolis14-Sep-11 5:21
ekolis14-Sep-11 5:21 
AnswerRe: Stored Proedure Pin
Simon_Whale14-Sep-11 6:05
Simon_Whale14-Sep-11 6:05 
QuestionJSON in a console application Pin
oakleaf13-Sep-11 8:35
oakleaf13-Sep-11 8:35 
QuestionInsufficient Base Table Information for Updating and Refreshing Pin
Ravindra Bisen13-Sep-11 5:03
Ravindra Bisen13-Sep-11 5:03 
AnswerRe: Insufficient Base Table Information for Updating and Refreshing Pin
Richard MacCutchan13-Sep-11 5:26
mveRichard MacCutchan13-Sep-11 5:26 
QuestionSave MsFlexgrid Table in Ms.Acess Pin
Lek Plepi12-Sep-11 3:57
Lek Plepi12-Sep-11 3:57 
AnswerRe: Save MsFlexgrid Table in Ms.Acess Pin
Eddy Vluggen12-Sep-11 12:14
professionalEddy Vluggen12-Sep-11 12:14 
GeneralRe: Save MsFlexgrid Table in Ms.Acess Pin
Lek Plepi12-Sep-11 23:06
Lek Plepi12-Sep-11 23:06 
AnswerRe: Save MsFlexgrid Table in Ms.Acess Pin
Eddy Vluggen13-Sep-11 6:45
professionalEddy Vluggen13-Sep-11 6:45 
QuestionCombobox 2 ListView Pin
Lek Plepi12-Sep-11 2:39
Lek Plepi12-Sep-11 2:39 
AnswerRe: Combobox 2 ListView Pin
Wayne Gaylard12-Sep-11 2:48
professionalWayne Gaylard12-Sep-11 2:48 
GeneralRe: Combobox 2 ListView Pin
Lek Plepi12-Sep-11 2:57
Lek Plepi12-Sep-11 2:57 
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 

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.