I want to write a simple string in a text file using the stream writer class,But it doesn't seem to work(and there are no errors).here's my code:
StreamWriter test = new StreamWriter("mytext.txt", true);
// used the below code too to create the file. It didn't work either!
//StreamWriter test = File.CreateText("mytext.txt");
test.WriteLine("hello");
when I run this code,nothing will be added to the text file!Where did I go wrong?(ps:I used the full path file names too!but it didn't work!)