I have written the following function
When i am creating the streamreader I have specified of 512 (I presume thats bytes) for the buffer. Thats fine but i am also given the option when reading from the stream reader to .Read(Buffer,In dex, Count) what is the difference between the two buffer sizes?
Cheers
Code:
Public Function ReadFile(ByVal FileName As String) As String
Dim objReader As StreamReader = Nothing
Dim objData As New StringBuilder
Dim strReturn As String = ""
Try
objReader = New StreamReader(FileName, Encoding.Default, True, 512)
objData.Append(objReader.ReadToEnd)
strReturn = objData.ToString
Catch Ex As Exception
objReader.Dispose()
strReturn = Ex.Message
Finally
objReader.Dispose()
End Try
Return strReturn
End Function
Cheers