如题 。

解决方案 »

  1.   

    合法?是要判断文件存不存在还是说文件名写法合法
    1.存不存在:用access函数判断
    2.如C:\\f\\df\\dfd.txt这样的就叫合法,就是用\分隔
      

  2.   

    看你的合法的要求是...
    _access
      

  3.   

    用CFileFind:
    CFileFind finder;
    BOOL bWorking = finder.FindFile("C:\bbb");//把参数用你的字符串代替
    if(!bWorking)
    {
        AfxMessageBox("不存在!");
    }
    上面是判断一个路径,判断文件名类似
      

  4.   

    you can use the CreateFile to create a new file.of course, the lpFileName be used by your filename.if the function succeeds. the explain the filename is good name.