I am trying to read text from a text file, change it and the write it back to the same file. I am using the Io.streamReader and streamWriter.
I can't seem to get it to work because when it gets to the file.writeline(myFText), i receive an IOException, The file: "....MyFIle.txt" is in use"
I have tried adding file.close and file.dispose after ever instance of it, but it does not help.
Essentially, all i really want to do is add a line of text to the beginning of the file. If there is a better way to do that, i'd appreciate any suggestions.
Thank you
I can't seem to get it to work because when it gets to the file.writeline(myFText), i receive an IOException, The file: "....MyFIle.txt" is in use"
I have tried adding file.close and file.dispose after ever instance of it, but it does not help.
Essentially, all i really want to do is add a line of text to the beginning of the file. If there is a better way to do that, i'd appreciate any suggestions.
Thank you