GetFileAttributes返回DWORD,每一bit对应一属性,不会互相覆盖的
Function IsDirectory(AString:String):boolean;
var AttrWORD;
begin
Result:=false;
Attr:=GetFileAttributes(PChar(AString));
if Attr=$0ffffffff then
ShowMessage('Get attributes error')
else
Result:=Attr and FILE_ATTRIBUTE_DIRECTORY>0;
end;