C#ウィンドウを閉じると、ファイル名にタイムスタンプを追加することを望みます。私は以下のコードを実行したときしかし、私は、このようなエラーを得た:クローズドファイルの名前を変更する
'System.NotSupportedException'
と
"The given path's format is not supported.".
は、パラメータを変更する方法はありますか?
private void Window_Closed(object sender, EventArgs e)
{
sw_bea.Close();
String file_Time = DateTime.Now.ToString("h:mm:ss tt").ToString();
System.IO.File.Move(@"C:\Users\abc\Desktop\tmp_bea.txt", @"C:\Users\abc\Desktop\tmp_bea"+file_Time+".txt");
}
ような何かを行うことができます。 – LarsTech