Sunday, 18 August 2013

Is there a way to create a text file using a string name in C#

Is there a way to create a text file using a string name in C#

I'm not sure if it's possible. I usually create txt files like this:
FileStream fs = new FileStream("c:\\textFile.txt", FileMode.Append,
FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
but instead of using "c:\textFile.txt" I want to create a file using a
string name. Is there a way to do it?

No comments:

Post a Comment