if (!File.Exists("SomeFile.exe"))
{
//Does not exists
}
I have SomeFile.exe in the same path as the exe but the result is Does not Exists.
This does not happen in Windows Form, does something change?
if (!File.Exists("SomeFile.exe"))
{
//Does not exists
}
I have SomeFile.exe in the same path as the exe but the result is Does not Exists.
This does not happen in Windows Form, does something change?
If your testing it from VS then the current directory is the Project dir not the release/debug folder (where your exe is)
Try this to get the file in the executables directory.
string directory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
string filePath = Path.Combine(directory, "SomeFile.exe");
if (!File.Exists(filePath))
{
// 1337 code here plx.
}