G
Guest
I'm trying to compare DirectoryInfo.Attributes to FileAttributes like so:
// result returning
// Directory | Archive
DirectoryInfo info = new DirectoryInfo(this.folderFullName);
if (info.Attributes != FileAttributes.Directory)
{
throw new FoundFileException(this.folderFullName);
}
for some reason it returns true. why?
i eventually had to add a line after the info declaration like so.
string[] nfo = info.Attributes.ToString().Split(',');
and my new test will be like:
if(nfo[0] != FileAttributes.Directory.ToString() )
{
throw new FoundFileException(this.folderFullName);
}
Why is this the case???
// result returning
// Directory | Archive
DirectoryInfo info = new DirectoryInfo(this.folderFullName);
if (info.Attributes != FileAttributes.Directory)
{
throw new FoundFileException(this.folderFullName);
}
for some reason it returns true. why?
i eventually had to add a line after the info declaration like so.
string[] nfo = info.Attributes.ToString().Split(',');
and my new test will be like:
if(nfo[0] != FileAttributes.Directory.ToString() )
{
throw new FoundFileException(this.folderFullName);
}
Why is this the case???