I cannot write text to a text file
See the question and my original answer on StackOverflowYou don't need to create the file, StreamWriter will do it for you. But you need to ensure the directory exists, like you do.
You can also use File.OpenText.
You don't need to create the file, StreamWriter will do it for you. But you need to ensure the directory exists, like you do.
You can also use File.OpenText.