473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Putting stream text data into a string possible without a fixed-sized buffer?

Hi,

I do a webrequest and it returns some text data in a stream. I want to
put this tyext 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. 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!)
' responseStream. Length.ToString () ' <- Can't get the
length to signify the buffer size ???

Any kind of help will do,

thankyou

Jack.

Jul 20 '07 #1
0 1300

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2112
by: R.G. Vervoort | last post by:
Is it possible to change selected text in a textarea without using java and only php or html. There are lots of solutions in a javascript but i would like to try it without. If it is possible to place the in a textarea selected text in the return of a function i like to believe is can be done. So how kan i put selected text in a string. ...
5
8575
by: adrian | last post by:
hi all this is my first post to this group, so pls bear with me while i try to make some sense. i am trying to create a sproc which uses dynamic sql to target a particuar table eg. '.' and perform some actions. i am using @tableID as a passes parameter for the sproc.
1
359
by: Rohit Sharma | last post by:
Hi All, I want to catch a stream as a string.....please see below: Dim stXML As Stream Dim sReturn as string dsResult.WriteXml(stXML) I want the value of the stream stXML as a string. stXML is a stream.
1
1767
by: Ola Theander | last post by:
Dear subscribers I'm currently creating a small application that will run at the end of a web installation to configure a SQL Server. For this task I have a SQL batch file in the same format as SQL Query Analyzer uses. I would prefer not to merge the content of this file into the source code of configuration application but instead keep...
3
5069
by: Wade G. Pemberton | last post by:
Help!: I use javascript to format repetitive data from a web page input FORM into a long string , and save it as lines of comma delimited data in a text file on a Unix server. The text file is meant to be downloaded to MS Excel on the users' computers. Several such files will be downloaded and appended into the Excel file. Problem:...
5
17090
by: Fernando Rodríguez | last post by:
Hi, How can I read everything inside a Stream into a String or StringBuilder? O:-) TIA
5
23663
by: ywchan | last post by:
I would like to convert a string to a fixed length e.g. if fixed length = 10 'abc' -> ' abc' 'abcdefghijklm' -> 'abcdefghij' Is there any simple function in C# can perform this operation? thanks!
4
1610
by: ad | last post by:
I have a Steam, it read from a text file. How can I convert this Stream to a String?
6
41554
by: John Dinning | last post by:
In 'C' it was possible to format a string to a fixed length, e.g. to 10 characters: printf("%10.10s","123456789012345"); would return "1234567890", and printf("%10.10s","12345"); would return " 12345" I can find no easy way to do this using string.format in C#. It is possible to set a minumum length e.g.
0
1012
by: hd95 | last post by:
I have an rss download stream I am parsing using the xmltextreader object. I am finding that lone ampersands and dashes in the content are screwing up the parsing process. If someone knows how to solve that issue then I don't need to do what I'm trying to do which is... load the stream into a string and do a find/replace there. i tried...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.