G
Guest
Are there any StringBuilder limitations that I should be aware of?
I'm trying to read a 2,261 byte file into a StringBuilder object with:
string fileName = info.OutputFile;
FileStream fileStream = new FileStream(
fileName, FileMode.Open );
StreamReader file = new StreamReader( fileStream
);
while ( file.Peek() != -1 )
sb.Append( file.ReadLine() + "\n" );
And if the user wishes to see the program output, they click a button on the
application which passes the class variable StringBuilder object to the form.
The form code looks like:
public Form2( StringBuilder sb ) : this()
{
DateTime now = DateTime.Now;
richTxtBox.AppendText( now.ToString() + "\n\r");
richTxtBox.AppendText( sb.ToString() );
}
The problem is that this (relatively small) 2,261 byte file is cut off in
the richTxtBox display.
I'm trying to read a 2,261 byte file into a StringBuilder object with:
string fileName = info.OutputFile;
FileStream fileStream = new FileStream(
fileName, FileMode.Open );
StreamReader file = new StreamReader( fileStream
);
while ( file.Peek() != -1 )
sb.Append( file.ReadLine() + "\n" );
And if the user wishes to see the program output, they click a button on the
application which passes the class variable StringBuilder object to the form.
The form code looks like:
public Form2( StringBuilder sb ) : this()
{
DateTime now = DateTime.Now;
richTxtBox.AppendText( now.ToString() + "\n\r");
richTxtBox.AppendText( sb.ToString() );
}
The problem is that this (relatively small) 2,261 byte file is cut off in
the richTxtBox display.