{
int i,j = 0
for(i = 0 path[i] i ++)
if(path[i] == '\\') j = i
strcpy(name, &path[j])
}
这样得到的name就是你需要的。
WIN32_FIND_DATA find_data
HANDLE search_handle
search_handle = FindFirstFile( DirectoryPath,&find_data )
if (search_handle != INVALID_HANDLE_VALUE)
{
do
{
if (find_data.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
{
CString name = find_data.cFileName
if( (name == ".")||(name == "..") )
continue
}
}while(FindNextFile(search_handle,&find_data))
FindClose(search_handle)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)