I need to detect is my input string a file name or a directory name?
In my windows app I use this code:
private bool IsFolder(string path)
{
return ((File.GetAttributes(path) & FileAttributes.Directory) == FileAttributes.Directory);
}
but how can I do this check in Windows Phone 7? (7.1 if it’s important)
Is any other way except check like this
if(storage.DirectoryExists(path)) return false; //and so on...
else ...
?
Thank you.
There’s nothing special available to do this.
Just test if it’s a file.
If not, test if it’s a directory.
If not that, it’s neither.