You can try this code: this will read data from app.config for folder path. if the the path is not found then it it will create folder.
string curDirectory = ConfigurationManager.AppSettings["AppOutPath"];
if (Directory.Exists(curDirectory + @"\Uploads"))
{
// Do something
}
else
{
Directory.CreateDirectory(curDirectory + @"\Uploads");
// Do something
}
Comments
Post a Comment