J
Jack
Hi,
I do a webrequest and it returns some text data in a stream. I want to
put this text data into a string. I've got it working just fine, but I
have to
put the text data into into a fixed-size buffer BEFORE I put it into a
string (ConstBufferByteSize=1000000). This fixed size buffer wastes
space. Is
it possible to somehow assign it straight to a string, or somehow do
this 'dynamically' ?
'' Put the XML response into a string to display
Dim tempBuffer(ConstBufferByteSize) As Byte
Dim enc As New System.Text.ASCIIEncoding
' responseStream.Length.ToString() ' <- Can't seem to get
the length to signify the buffer size here ???
responseStream.Read(tempBuffer, 0,
ConstBufferByteSize) ' Read from the stream x bytes and put into a
temporary buffer
responseStream.Close() ' Close
the request stream to free up resources
strResponse =
enc.GetString(tempBuffer) ' Put the response into
a string (finally!)
Any kind of help will do,
thankyou
Jack.
I do a webrequest and it returns some text data in a stream. I want to
put this text data into a string. I've got it working just fine, but I
have to
put the text data into into a fixed-size buffer BEFORE I put it into a
string (ConstBufferByteSize=1000000). This fixed size buffer wastes
space. Is
it possible to somehow assign it straight to a string, or somehow do
this 'dynamically' ?
'' Put the XML response into a string to display
Dim tempBuffer(ConstBufferByteSize) As Byte
Dim enc As New System.Text.ASCIIEncoding
' responseStream.Length.ToString() ' <- Can't seem to get
the length to signify the buffer size here ???
responseStream.Read(tempBuffer, 0,
ConstBufferByteSize) ' Read from the stream x bytes and put into a
temporary buffer
responseStream.Close() ' Close
the request stream to free up resources
strResponse =
enc.GetString(tempBuffer) ' Put the response into
a string (finally!)
Any kind of help will do,
thankyou
Jack.