转义字符中要判断双杠:
判断字符串中是否包含非法字符“:/*?/"<>|”和空格跟//
BOOL IsInvalidPath( LPCTSTR lpszFilePath )//modiy by tanl
{
CString strPath = lpszFilePath;
static TCHAR szInvalidChar[] = _T(":/*?/"<>| ");
if( strPath.FindOneOf( szInvalidChar ) != -1)
return TRUE;
char sTemp[] = "";//判断双杠的过程
if(strPath.Find(sTemp) !=-1)
return TRUE;
return FALSE;
};
问题虽小,但还是折腾我很长时间,转义字符的使用这次算记住了