I have recently had a pretty weird problem: I wanted to read multiple bytes from a StreamReader object. Unfortunately, the necessary command was omitted from the .NET CF version of the control. As this is highly annoying (IMHO), please allow me to share the following code snippet with you:
Private Function ReadMultipleBytes(ByVal howmany As Integer, ByVal reader As StreamReader)
Dim counter As Integer = howmany
Dim output As String = ""
While counter > 0
output.Insert(output.Length, reader.Read())
counter = counter - 1
End While
ReadMultipleBytes = output
End Function
Related posts:






