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 (ConstBufferByt eSize=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(Cons tBufferByteSize ) As Byte
Dim enc As New System.Text.ASC IIEncoding
' responseStream. Length.ToString () ' <- Can't seem to get
the length to signify the buffer size here ???
responseStream. Read(tempBuffer , 0,
ConstBufferByte Size) ' 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(t empBuffer) ' 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 (ConstBufferByt eSize=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(Cons tBufferByteSize ) As Byte
Dim enc As New System.Text.ASC IIEncoding
' responseStream. Length.ToString () ' <- Can't seem to get
the length to signify the buffer size here ???
responseStream. Read(tempBuffer , 0,
ConstBufferByte Size) ' 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(t empBuffer) ' Put the response into
a string (finally!)
Any kind of help will do,
thankyou
Jack.
Comment