Hi All,
Just wondering if there is an easy/preferred way using the .netmf libraries to convert a bytestream (From a http get request) into a string.
For contexts the code so far: (Thanks for the networking documentation )
Private Sub Login()
ClearScreen(Colors.White)
Dim img As Bitmap = LoadImage("connecting.bmp")
DrawBitmap(img, 110, 5)
DrawText("Please wait " & _username & " Connecting you...", 130, 10, GT.Color.Blue)
Dim result As Byte() = New Byte(65536) {}
Dim read As Integer = 0
Using req As WebRequest = HttpWebRequest.Create(_baseURI & "TcibCusLists()")
req.ContentType = "application/json"
Dim authInfo As String = _username & ":" & _password
authInfo = Convert.ToBase64String(Encoding.UTF8.GetBytes(authInfo))
req.Headers.Add("Authorization", "Basic " & authInfo)
Try
Using res = req.GetResponse()
Using readStream = res.GetResponseStream
Do
read = readStream.Read(result, 0, result.Length)
' Do Decode
Thread.Sleep(20)
Loop While read <> 0
End Using
End Using
Catch ex As Exception
FatalError("Login", ex.Message)
End Try
End Using
Debug.Print("Connected...")
End Sub