I'm trying to "move" a file and rename it using File.Move
. It worked before I needed to add store files in a specific folder. Since adding the full path, I can create files, I can write to them but as soon as I try to use File.Move
it gives me "NotSupportedException"
an example of some of the code that I have is:
private static void myMethod(String file)
{
File.Delete(file);
using (sout = new StreamWriter(pathStart + "temp.txt"))
{
foreach(Deck deck in deckList)
{
if (deck != null)
{
sout.WriteLine(myString);
sout.WriteLine(otherString);
sout.Flush();
}
}
}
File.Move(pathStart + "temp.txt", pathStart + file);
File.Delete(pathStart + "temp.txt");
}
Any help would be greatly appreciated.