read/write with Visual C++ (VS2010 windows forms) Q

When I use this code to write to a txt file I also get (See below)

1
2
3
4
5
6
7
			 String^ qfileName = "c:\\studyfiles\\question";
			 qfileName+=numAns;
			 qfileName+=".txt";	

			 StreamWriter^ outfile = gcnew StreamWriter(qfileName);				 
			 outfile->Write(txtQuestion->ToString());
			 outfile->Close();


this output into the txt file...how can I tell my program not to add that System.... into the output?

1
2
c:\studyfiles\question1.txt
System.Windows.Forms.TextBox, Text: some text i typed in to test


That shows up in the txt file or in a text box, any where I send the write, it prints all that junk. anyone know whats wrong with my writer?
Last edited on
Topic archived. No new replies allowed.