C# File Disappeared after FileInfo.MoveTo with Local Path (Windows)

224 Views Asked by At

I Ran FileInfo.MoveTo("filename.txt") with just a name instead of passing a full path and the file just disappeared. I believe in linux this would make it go to the root directory "/", but on Windows I'm not sure if there is a such thing as a root directory beyond just C: Is there any way to locate my lost file?

2

There are 2 best solutions below

2
Classic_Fungus On BEST ANSWER

It should be in project folder. Usually files without specefying path are saved there. (in folder with .exe file)

1
Kip Morgan On

It is likely in the working folder that your executable is running from. For example, MyApp\bin\Debug, depending on the configuration you are running in.