Why am I pointing to two different directory paths in the following C# code and how can I resolve it?
Posted on 2016-08-30
I am writing a C# application using .Net Framework 4.0
I have a snippet of code as follow in my program:
Why am I pointing to two different directory paths in the following code?
The filenames are the same.
My correct path is defined by TARGET_DIR_IN
However, "File.ReadAllBytes(fileName)" defines the path as "\\m\USERS\z\My Documents\Visual Studio 2010\Projects\W\bin\Debug\20160824.ard.out'" as I can tell from the debugger.
const string TARGET_DIR_IN = @"\\v\na\ctrls\dev\W\data\Test\";
string files = Directory.GetFiles(TARGET_DIR_IN, "*.out", SearchOption.TopDirectoryOnly);
foreach (string file in files)
string fileName = Path.GetFileName(file);
byte imgBits = File.ReadAllBytes(fileName);