Click here to Skip to main content
15,914,924 members
Home / Discussions / C#
   

C#

 
AnswerRe: New to C# Programming Pin
ghle24-Aug-07 11:04
ghle24-Aug-07 11:04 
AnswerRe: New to C# Programming Pin
humayunlalzad24-Aug-07 11:19
humayunlalzad24-Aug-07 11:19 
GeneralRe: New to C# Programming Pin
Colin Angus Mackay24-Aug-07 14:19
Colin Angus Mackay24-Aug-07 14:19 
AnswerRe: New to C# Programming Pin
Christian Graus24-Aug-07 11:47
protectorChristian Graus24-Aug-07 11:47 
GeneralRe: New to C# Programming Pin
invalidsyntax101024-Aug-07 12:05
invalidsyntax101024-Aug-07 12:05 
GeneralRe: New to C# Programming Pin
ChrisKo24-Aug-07 12:56
ChrisKo24-Aug-07 12:56 
AnswerRe: New to C# Programming Pin
Luc Pattyn24-Aug-07 13:28
sitebuilderLuc Pattyn24-Aug-07 13:28 
AnswerRe: New to C# Programming Pin
George L. Jackson24-Aug-07 14:02
George L. Jackson24-Aug-07 14:02 
Newsyou guys rock Pin
invalidsyntax101024-Aug-07 15:54
invalidsyntax101024-Aug-07 15:54 
AnswerRe: New to C# Programming Pin
Thomas Stockwell25-Aug-07 2:31
professionalThomas Stockwell25-Aug-07 2:31 
GeneralRe: New to C# Programming Pin
George L. Jackson25-Aug-07 3:12
George L. Jackson25-Aug-07 3:12 
Question(nOOb help) comparing ArrayLists of structs.. Pin
Dio2224-Aug-07 9:43
Dio2224-Aug-07 9:43 
AnswerRe: (nOOb help) comparing ArrayLists of structs.. Pin
ghle24-Aug-07 11:08
ghle24-Aug-07 11:08 
AnswerRe: (nOOb help) comparing ArrayLists of structs.. Pin
Luc Pattyn24-Aug-07 13:37
sitebuilderLuc Pattyn24-Aug-07 13:37 
QuestionHow do I incorporate these two routines? Pin
solutionsville24-Aug-07 9:21
solutionsville24-Aug-07 9:21 
AnswerRe: How do I incorporate these two routines? Pin
Hessam Jalali24-Aug-07 9:55
Hessam Jalali24-Aug-07 9:55 
AnswerRe: How do I incorporate these two routines? Pin
solutionsville24-Aug-07 10:16
solutionsville24-Aug-07 10:16 
AnswerRe: How do I incorporate these two routines? Pin
Big Daddy Farang24-Aug-07 12:37
Big Daddy Farang24-Aug-07 12:37 
solutionsville wrote:
or am I out of my mind.

Nothing here leads me to that conclusion. Big Grin | :-D

If I understand correctly what you mean by incorporating the two routines, you might be able to do something like this.
StringCollection ReadFileIntoStringCollection()
{
	const int MaxBytes = 65536;
	StreamReader sr = new StreamReader ( chosenFile );
	StringCollection result = new StringCollection();
	int nBytesRead = 0;
	string nextLine;
	while ( ( nextLine = sr.ReadLine() ) != null )
	{
		nBytesRead += nextLine.Length;
		if ( nBytesRead > MaxBytes )
			break;
		// copy and paste the guts of LayoutInput to here
		// instead of returning sb.ToString() do
		// result.Add ( sb.ToString() ) ;
		result.Add ( nextLine );
	}
	sr.Close();
	return result;
}

When I say "guts" I mean leave out the first few lines, start with the declaration of sb and go through the end of the while loop. Once you do that there may be some compilation errors or warnings to fix, but I think it should work. Or can be made to work.

Hope that's more or less what you had in mind.


BDF
AnswerRe: How do I incorporate these two routines? [modified] Pin
solutionsville24-Aug-07 17:54
solutionsville24-Aug-07 17:54 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 10:03
Big Daddy Farang27-Aug-07 10:03 
AnswerRe: How do I incorporate these two routines? Pin
solutionsville27-Aug-07 12:32
solutionsville27-Aug-07 12:32 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 12:39
Big Daddy Farang27-Aug-07 12:39 
Questiongetting infragistics Pin
starist24-Aug-07 9:12
starist24-Aug-07 9:12 
AnswerRe: getting infragistics Pin
Alaric_24-Aug-07 9:27
professionalAlaric_24-Aug-07 9:27 
GeneralRe: getting infragistics Pin
Dan Neely24-Aug-07 10:06
Dan Neely24-Aug-07 10:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.