• 容器


    /*获取文件夹路径下所有的xml文件并放入容器中*/
     1     /******************************************/
     2     /*获取文件夹路径下所有的xml文件并放入容器中*/
     3      
     4     CString  csDirPath;
     5     CFileDialog dlg(TRUE);///TRUE为OPEN对话框,FALSE为SAVE AS对话框  
     6     CString m_csFileName;
     7     if (dlg.DoModal() == IDOK)
     8     {
     9         m_csFileName = dlg.GetPathName();
    10     }
    11     else{
    12         m_csFileName.Empty();
    13         return;
    14         }
    15     int iEndPos = 0;
    16     iEndPos = m_csFileName.ReverseFind('\');
    17     csDirPath = m_csFileName.Left(iEndPos);
    18 
    19     csDirPath += "\*.xml";
    20     HANDLE file;
    21     WIN32_FIND_DATA fileData;
    22     //char line[1024];  
    23     //char fn[1000];  
    24     /*vector<CString> m_FileList;*/
    25     //mbstowcs(fn,csDirPath.GetBuffer(),999);  
    26     m_FileList.clear();
    27     file = FindFirstFile(csDirPath.GetBuffer(), &fileData);
    28      
    29     CString DirpathOne = m_csFileName.Left(iEndPos)+"\"+ fileData.cFileName;
    30     m_FileList.push_back(DirpathOne);
    31     BOOL bState = false;
    32     bState = FindNextFile(file, &fileData);
    33     while (bState){
    34         //wcstombs(line,(const char*)fileData.cFileName,259);  
    35         CString Dirpath = m_csFileName.Left(iEndPos)+"\"+ fileData.cFileName;
    36         m_FileList.push_back(Dirpath);
    37         bState = FindNextFile(file, &fileData);
    38     }
    39 
    40     UpdateData(TRUE);
    41     char DirTemp[300];
    42     for (int i=0; i < m_FileList.capacity();i++)
    43     {
    44         CstringToch(m_FileList.at(i), DirTemp);
    45         if (!MUltiModifyXMl(DirTemp))
    46         {
    47             MessageBox(_T("modify uncompeleted in " + m_FileList.at(i)));
    48         }
    49         
    50         
    51     }
    52     MessageBox(_T("MUltiModifyXMl ends"));


     

  • 相关阅读:
    android: 记录及回复lisView的位置
    android获取屏幕尺寸、密度
    iphone:蓝牙传输
    android 线程 进程
    android 首次使用app时的使用教程的功能的实现
    android 启动界面
    iphone:数组的反序
    android:onKeyDown
    iphone: 可编辑的tableView Move&Delete
    iphone:类似path的抽屉式导航效果的demo总结
  • 原文地址:https://www.cnblogs.com/xifengib/p/6255749.html
Copyright © 2020-2023  润新知