c# detect if path inside directory code example
Example 1: c# check if a directory exists
string directory = @"C:\folder name";
if (Directory.Exists(directory)
{
// Directory exits!
}
Example 2: c# check if string is directory
File.GetAttributes(data.Path).HasFlag(FileAttributes.Directory)