//strPath为需要判断的路径 //http://www.sharejs.com if ( GetFileAttributes(strPath) & FILE_ATTRIBUTE_DIRECTORY ) { MessageBox("Is a Directory"); } else { MessageBox("Is not a Directory"); }