I'm having the following problem, but can not identify the error, he points out that this is part of "Me.sr.Read (Me.srcBT, 0, CInt (Me.sr.Length))". Help.
Public Function getFile(ByVal srcFile As String) As String
Dim result As String
If File.Exists(srcFile) Then
Using sr As FileStream = New FileStream(srcFile, FileMode.Open, FileAccess.ReadWrite, FileShare.None)
Dim srcBT(CInt(sr.Length) + 1) As Byte
Me.sr.Read(Me.srcBT, 0, CInt(Me.sr.Length))
Me.sr.Flush()
Me.sr.Dispose()
Me.sr.Close()
result = Encoding.[Default].GetString(Me.srcBT)
Return result
End Using
End If
result = Nothing
Return result
End Function