Click here to Skip to main content
15,917,061 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Excel connection Pin
Socheat.Net15-Jan-07 23:56
Socheat.Net15-Jan-07 23:56 
QuestionJavascript Help [modified] Pin
Navneet Hegde14-Jan-07 23:02
Navneet Hegde14-Jan-07 23:02 
AnswerRe: Javascript Help Pin
Christian Graus14-Jan-07 23:58
protectorChristian Graus14-Jan-07 23:58 
Questiondata retrive from database Pin
Pradip Kishore14-Jan-07 22:58
Pradip Kishore14-Jan-07 22:58 
QuestionASCII Text file generation Pin
him_mca14-Jan-07 22:57
him_mca14-Jan-07 22:57 
AnswerRe: ASCII Text file generation Pin
Christian Graus14-Jan-07 23:59
protectorChristian Graus14-Jan-07 23:59 
QuestionXML writing Pin
BobsAfro14-Jan-07 22:45
BobsAfro14-Jan-07 22:45 
Questionhow to read files fast? Pin
SilentBob10114-Jan-07 22:15
SilentBob10114-Jan-07 22:15 
Hi,

Just started to learn about reading files, text, binary, whatever. I thought, hey, I can make a Hex editor like this, beginning with a Hex reader offcourse. Got to start somewhere and I just want to learn.;P
Here's my code so far


  Dim bytArray As Byte()<br />
        Dim intFileLenght As Integer<br />
        Dim bldHexData As New StringBuilder<br />
        Dim bldCharData As New StringBuilder<br />
        Dim i As Integer<br />
<br />
        If dlgOpen.ShowDialog = DialogResult.OK Then<br />
            strFileName = dlgOpen.FileName<br />
<br />
        End If<br />
<br />
        Me.Text = strFileName<br />
<br />
        Dim strmFile As New FileStream(strFileName, FileMode.Open, FileAccess.Read, FileShare.Read)<br />
        Dim rdrFile As New BinaryReader(strmFile)<br />
<br />
        intFileLenght = strmFile.Length<br />
<br />
        bytArray = rdrFile.ReadBytes(intFileLenght)<br />
<br />
        For i = 0 To bytArray.Length - 1<br />
            Select Case True<br />
                Case bytArray(i) = 0<br />
                    bldHexData.Append("0" & bytArray(i).ToString("X") & " ")<br />
                    bldCharData.Append(".")<br />
                Case bytArray(i) < 16<br />
                    bldHexData.Append("0" & bytArray(i).ToString("X") & " ")<br />
                    bldCharData.Append(Chr(bytArray(i)))<br />
<br />
                Case bytArray(i) >= 16<br />
                    bldHexData.Append(Hex(bytArray(i)).ToString & " ")<br />
                    bldCharData.Append(Chr(bytArray(i)))<br />
<br />
            End Select<br />
<br />
        Next<br />
<br />
        txtHex.Text = bldHexData.ToString<br />
        txtChar.Text = bldCharData.ToString


This works on small files, but crashes on anything big (say, a divx movie of 700 MB), gives an OutOfMemoryException. Anyone know VirtualDub? It has a Hex editor, it opens a file instantly.

What magic is this? How do they do that? Is it at all possible in VB.Net?




If you want to know The Truth, STOP lying.

AnswerRe: how to read files fast? Pin
Colin Angus Mackay14-Jan-07 22:27
Colin Angus Mackay14-Jan-07 22:27 
GeneralRe: how to read files fast? Pin
SilentBob10114-Jan-07 22:44
SilentBob10114-Jan-07 22:44 
GeneralRe: how to read files fast? Pin
Colin Angus Mackay14-Jan-07 23:19
Colin Angus Mackay14-Jan-07 23:19 
GeneralRe: how to read files fast? Pin
SilentBob10114-Jan-07 23:32
SilentBob10114-Jan-07 23:32 
GeneralRe: how to read files fast? Pin
Colin Angus Mackay15-Jan-07 1:26
Colin Angus Mackay15-Jan-07 1:26 
GeneralRe: how to read files fast? Pin
roo42615-Jan-07 1:26
roo42615-Jan-07 1:26 
GeneralRe: how to read files fast? Pin
Colin Angus Mackay15-Jan-07 1:55
Colin Angus Mackay15-Jan-07 1:55 
Questionpassing value from one form to another Pin
Pradip Kishore14-Jan-07 20:22
Pradip Kishore14-Jan-07 20:22 
AnswerRe: passing value from one form to another Pin
Alex@UEA14-Jan-07 21:55
Alex@UEA14-Jan-07 21:55 
GeneralRe: passing value from one form to another Pin
Christian Graus15-Jan-07 0:07
protectorChristian Graus15-Jan-07 0:07 
GeneralRe: passing value from one form to another Pin
Pradip Kishore15-Jan-07 0:45
Pradip Kishore15-Jan-07 0:45 
AnswerRe: passing value from one form to another Pin
Colin Angus Mackay14-Jan-07 22:28
Colin Angus Mackay14-Jan-07 22:28 
QuestionHow can i upload an entire folder Pin
fmlove14-Jan-07 20:20
fmlove14-Jan-07 20:20 
AnswerRe: How can i upload an entire folder Pin
StianSandberg14-Jan-07 21:49
StianSandberg14-Jan-07 21:49 
Questiondatagridview in vb.net [modified] Pin
amaneet14-Jan-07 20:09
amaneet14-Jan-07 20:09 
AnswerRe: datagridview in vb.net Pin
priya_p23314-Jan-07 23:09
priya_p23314-Jan-07 23:09 
GeneralRe: datagridview in vb.net Pin
amaneet14-Jan-07 23:48
amaneet14-Jan-07 23:48 

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.