Hello forum
I am happy I'm here, and there are lot of programmers who love .NET.
Well, this is my code to read a file:
Do you guys think this is a correct way to do this?
Is there a better and easier way to do the same in VB.NET?
While I am reading some tutorials on .NET language and file operations but I needed a quicker way to know this. :-\
I am happy I'm here, and there are lot of programmers who love .NET.
Well, this is my code to read a file:
Visual Basic:
Dim f As System.IO.File 'Reference to file object
Dim fs As System.IO.FileStream 'Reference to Filestream object
fs = f.Open(Filename.Text, IO.FileMode.Open, IO.FileAccess.Read)
' Allocate a byte array accoording to file length
Dim b(fs.Length - 1) As Byte
' Read the entire file
fs.Read(b, 0, fs.Length)
' Cleanup file+Stream
f = Nothing
fs.Close()
Is there a better and easier way to do the same in VB.NET?
While I am reading some tutorials on .NET language and file operations but I needed a quicker way to know this. :-\