473,769 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I overcome the buffer limitation using StreamReader.Re adTo

Hi, I'm using VS 2005, ,.net 2 for C# windows application. I'm using Process
to run a C application and redirecting its standard output so I can read it
with StreamReader.Re adToEnd. It's only reading the 1st 5 lines or so when
there is about 30 lines of data.
I also tried using the Process.BeginOu tputReadlin and a
DataReceivedEvn tHandler to gather output but I also only get about 5 lines of
the data.
There seems to be a buffer size issue. Can someone tell me how can I
resolve this problem. Thank you.
--
Thanks.
Aug 3 '07
11 9243
Jon, thank you for all your help. It's now working. My eventhandler was
stripping the \n (in String.Append) and through my code it was retuning 0
records when it didn't find \n. But the process redirect is wokring
properly.

--
Thanks.
"Jon Skeet [C# MVP]" wrote:
Pucca <Pu***@discussi ons.microsoft.c omwrote:
Ok, I will do that. Sounds like a good test. Also, I forgot to mention that
I'm running on Windows 2000 server. Would this be the problem?

Shouldn't be, no.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Aug 6 '07 #11
Pucca <Pu***@discussi ons.microsoft.c omwrote:
Jon, thank you for all your help. It's now working. My eventhandler was
stripping the \n (in String.Append) and through my code it was retuning 0
records when it didn't find \n. But the process redirect is wokring
properly.
Excellent - glad to hear it :)

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Aug 6 '07 #12

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

Similar topics

8
6819
by: codefixer | last post by:
Hi, I was wondering what factors will influence the maximum buffer sizes for source and destination for memcpy(). Is their any limit to the sizeof the buffer(hardware restricting it ?) OR any other limitations like the compiler being used ? Your thoughts are appreciated. Thanks.
6
7245
by: BMax | last post by:
Hello I want to create a byte and use it as a buffer, then access it with a binaryreader or streamreader. what is important is to be able to read different variables form that, like readint16, readbytes(),readint32.... . so if there is a method to read byte arrays that would also help. (i couldn' use convert class ) is that possible? if yes how?
4
1426
by: ad | last post by:
Have there any limitation about the size of the file uploaded by FileUpload control?
4
4620
by: chenatcr | last post by:
Hello, I added a serial-USB converter to my laptop, it appear as USB serial port COM4, and I wrote an application to read 78k data from this port. In my VC++ express code, I defined ReadBufferSize = 78k, and ReceivedBytesThreashold = 78k so that I can get the whole data with one ReadExisting() method when DataReceived event fires.
4
3959
by: aki | last post by:
Hi all, i am writing codes for implementing network protocols. i have written a method which is receiving a packet from network. i have assumed that the packet i will receive will be of type char*. i need to test my method and for that i want to create a network buffer which will contain a packet of format as-> example of Configuration req packet uint8_t code;
2
6614
by: Jack | last post by:
Hi, I want to read a string a chars from a stream, and put it into a string. At the moment, I'm creating a buffer of a fixed size, and reading the stream of text into it. It works, but I have to create a buffer of a pre-defined length: (ConstBufferByteSize=10000000). How can I read a stream into a buffer or string without knowing the number of chars the stream will contain?
0
3020
by: =?Utf-8?B?UHVjY2E=?= | last post by:
-- Hi I'm using vs2005, .net 2 for windows application. The application I started using System.Diagnostics.Process is having a "listFiles.StandardOutput" buffer size problem. I was wondering where and how can I adjust the buffer size problem. I don't want to be limited to a set buffer size, is that possible? thank you. public static int GetNisFile(System.Diagnostics.ProcessStartInfo psi, ref DataTable dtAccounts, ref...
1
3088
by: lapucca | last post by:
Hi, I'm using VS 2005, ,.net 2 for C# windows application. I'm using Process to run a C application and redirecting its standard output so I can read it with StreamReader.ReadToEnd. It's only reading the 1st 5 lines or so when there is about 100 lines of data. I also tried using the Process.BeginOutputReadlin and a DataReceivedEvntHandler to gather output but I also only get about 5 lines of the data. There seems to be a buffer...
0
916
by: bennett | last post by:
I have written the following function Public Function ReadFile(ByVal FileName As String) As String Dim objReader As StreamReader = Nothing Dim objData As New StringBuilder Dim strReturn As String = "" Try objReader = New StreamReader(FileName, Encoding.Default, True, 512) objData.Append(objReader.ReadToEnd) strReturn =...
0
9579
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10038
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9987
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.