1. 程式人生 > >判斷檔案是否存在及建立資料夾

判斷檔案是否存在及建立資料夾

 CString  strFilePath =  "C:\\Documents and Settings\\Administrator\\桌面\\Image Mosaic Result";
 /*判斷資料夾是否存在*/
 if (!PathFileExists(strFilePath))
 {
  /*建立資料夾*/
  if (!CreateDirectory(strFilePath, NULL))
  {
     AfxMessageBox("Image Mosaic Result資料夾建立失敗!");
  }
 }

 strFilePath += "\\epipolar.jpg";
 string s;
 s.append(strFilePath.GetBuffer(strFilePath.GetLength()));
 strFilePath.ReleaseBuffer();

 imwrite(s, tmp);