Read file in byte array in vb.net : Public Function Reader(ByVal FilePath_ As String) As Byte() Dim BytArr(FileSystem.FileLen(FilePath_) – 1) As Byte Using fs As New FileStream(FilePath_, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) fs.Read(BytArr, 0, BytArr.Length) fs.Close() End Using Return BytArr End Function Read file in String : Public Function ReaderString(ByVal FilePath_ As String) As String Dim data_str As String Using fs As New FileStream(FilePath_, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite) Using Sr As New StreamReader(fs) data_str = Sr.ReadToEnd Sr.Close() fs.Close() End Using Return data_str End Using End Function Read File with Encoding (using default encoding…
Read More