I cannot rename a file located in (D-drive) using C #. I get an error
Exception Details: System.NotSupportedException: The specified format path is not supported.
everytime.
I use
string oldfilename = @"D:\abc\file.txt";
string newfilename = @"D:\abc\tree.txt";
System.IO.File.Move(oldfilename, newfilename);
but I get an error in the last line. I also tried changing the first 2 lines to
string oldfilename = "D:\\abc\\file.txt";
string newfilename = "D:\\abc\\tree.txt";
I also ensured the existence of the file.txt file. Tried to use a different location.
I also tried to read the contents of file.txt, but I get the same error. I searched all the questions about SO but no luck, I could solve this problem. I think there is some problem with ":" which I use after the drive letter when specifying the path. Please guide me.