How to Detect Invalid Filenames
-
Is there an API available to check if a filename is valid. At the moment the only information I can find is in the help for CreateFile() where it gives a list of invalid characters and filenames such as ./?\* or com1,con,lpt. Systems AXIS Ltd - Software for Business ...
-
Is there an API available to check if a filename is valid. At the moment the only information I can find is in the help for CreateFile() where it gives a list of invalid characters and filenames such as ./?\* or com1,con,lpt. Systems AXIS Ltd - Software for Business ...
-
Is there an API available to check if a filename is valid. At the moment the only information I can find is in the help for CreateFile() where it gives a list of invalid characters and filenames such as ./?\* or com1,con,lpt. Systems AXIS Ltd - Software for Business ...
Hello! if you only check the string of the filename,you can check if the string have the list of "./?;'". if you check whether the file is existent, you can use code as follow in VC6.0 : BOOL CheckIfFileExists (LPCTSTR szFileName) { ASSERT( szFileName != NULL ); if( _tcslen(szFileName) == 0 ) return FALSE; DWORD dwAttr = GetFileAttributes(szFileName); if( dwAttr == 0xFFFFFFFF ) return FALSE; return (dwAttr & FILE_ATTRIBUTE_DIRECTORY) == 0; } dupengfei