Jump to content

C# problem

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Pega

Pega

    Newbie

  • Members
  • Pip
  • 1 posts
i am an absolute beginner at this language (im doin it for college course) basically ive got a slight problem, what im trying to do is merge the text files, i have a few text files already saved, and i want all of them go into list box, now i developed this code, in builds, but when i press collate (or merge) it crashes, this is the code i have :
private void btnCollate_Click(object sender, System.EventArgs e)
		{
			String strTarget = "*.Text";
			string strLine =" ";
			TextReader LoadIn = new StreamReader(strTarget);
			while (strLine !=null)
			{
				strLine = LoadIn.ReadLine();
				if (strLine !=null)
					lstQBase.Items.Add(strLine);
			}
			LoadIn.Close();
now when it crashes, it points at this line:
TextReader LoadIn = new StreamReader(strTarget);

and says Illegal character in path
can u help me please?

Edited by Jaan, 03 October 2008 - 04:08 AM.
Use code tags when you're posting your codes!


#2
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
It looks like the asterisk that's the problem.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#3
Guest_jackspar_*

Guest_jackspar_*
  • Guests
Probably the error will be strtarget.


jackspar.
___________
Las vegas hotel Homeowners Insurance Quotes

#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Well, it seems like Pega is all right now, since he's disappeared.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums