UINT WINAPI GetDriveType( __in_opt LPCTSTR lpRootPathName );lpRootPathName [in, optional] The root directory for the drive.A trailing backslash is required. If this parameter is NULL, the function uses the root of the current directory.MSDN says The root directory for the drive. (This would be for ex. E:\ D:\ X:\ ) 不是盘符好像也能起作用 末尾一定要有backslash
比如是这样的,我有3个路径
1. D:\1_XXX\2_XX\3_X\*.CPP
2. W:\1_XXX\2_XX\3_X\*.CPP
3. \\NETPath\1_XXX\2_XX\3_X\*.CPP
其中1是本地磁盘的文件路径,3是网络服务器的文件路径,2是3的在本地磁盘上的映射,实际是同一路径,但是在不同的机器上盘符不一定是W,我用GetDriveType返回值都是1,我怎么区分1是本地磁盘,2、3是网络服务器路径呢,
__in_opt LPCTSTR lpRootPathName
);lpRootPathName [in, optional]
The root directory for the drive.A trailing backslash is required.
If this parameter is NULL, the function uses the root of the current directory.MSDN says
The root directory for the drive. (This would be for ex. E:\ D:\ X:\ )
不是盘符好像也能起作用
末尾一定要有backslash