ファイルを「移動」して、を使用して名前を変更しようとしていますFile.Move
。特定のフォルダーにストア ファイルを追加する必要がある前に、それは機能しました。フルパスを追加してから、ファイルを作成し、それらに書き込むことができますが、使用しようとするとすぐにFile.Move
「NotSupportedException」が表示され、コードの例は次のとおりです。
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");
}
どんな助けでも大歓迎です。