我必须写在C驱动器的perticuler路径上的文件我使用下面的代码它是上面的错误givin不支持给定路径的格式。不支持给定路径的格式。当传递路径我们必须通过什么样的路径
我的路径值是d:\ EA \ 10 \代表\ Demo.txt
System.IO.File.WriteAllText(path, string.Empty);
StreamWriter file2 = new StreamWriter(path, true);
file2.WriteLine("Demo");
file2.Close();
if (System.IO.File.Exists(path))
System.IO.File.Copy(path, @"D:\Demo.htm", true);
我的路径值是d:\ EA \ 10 \代表\ Demo.txt –
它不应该是'@ path'?我不认为将你的路径附加到符号@会做很多事情。 –
@ user2996030:你能运行你的代码吗? –