用什么语句逐个对文件夹里的文件进行操作那?
主要是获得文件的名字

解决方案 »

  1.   


    long hFile= 0L;
        struct _finddata_t c_file;
    CString SearchPath = "";
    CStringList valid_filenames ; SearchPath = m_strPath + "*.*";
    hFile = _findfirst(SearchPath, &c_file);
    if (hFile != -1L)
    {
    do
    {
       cout<<m_strPath + c_file.name<<endl;

    while (_findnext(hFile, &c_file) == 0);
    _findclose(hFile) ;
    }
      

  2.   

    FindFistFile    FindNextFile   FindClose
      

  3.   

    这两个例子足矣让你明白。
    http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx
    http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/4b0b011e-b037-4e64-ae9e-dd0f75d08949
      

  4.   

    我看了下面的网站很有用的,
    http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx
    http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/4b0b011e-b037-4e64-ae9e-dd0f75d08949