try
{
string directory = "C:\\Users\\Public\\Documents";
string filename = "DBCS.config";
string path = Path.Combine(directory, filename);
if (File.Exists(filename))
{
MessageBox.Show("I exist");
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
The code skips the messagebox everytime.
I checked to see if the file is actually there. The file is a simple text file.
You should use the variable
pathinstead offilename