1
Reply

C# check directory path exists

dc

dc

Feb 20 2013 12:22 PM
1.6k

In a C# 2008 application, I have a check to make certain the directory file does not exist. if it does not exist, then I want to display an error message. 

Here is the code I have so far:

string strFullpath = '"C:\\Data\\IFiles"

if (!Directory.Exists(strFullpath))

{

display error message

}

else

{

}

The code is not correct somehow. The directory file does exist. Thus can you tell me how to change this code to really check if the directory file does exist?

Answers (1)