When a form loads, I need to read a binary file under the /skubin
folder and use it to populate a List
. But I’m unable to open the file. When I do, I receive an error indicating that the file doesn’t exist.
Below is the snippet of my code which I am trying to read the file from the folder.
string startpath = Application.StartupPath;
string BinDir = Path.Combine(startpath, "skubin");
binNanme = Path.Combine(BinDir, "skuen.bin");
if (!File.Exists(binNanme))
{
MessageBox.Show("Load bin fail");
return;
}
When checking the BinDir
value, instead of pointing to <project_root>/skubin
, it's pointing to <project_root>/bin/Debug/skubin
.
I am not understanding why it is pointing to /bin/Debug
folder.