CString szTemp = "d:\VS project\IniPractice\debug\IniPractice.exe";
int nIndex1 = szTemp.Find('\\');
//nIndex1 = 2; 从左往右查找,并给出索引值
int nIndex2 = szTemp.ReverseFind('\\');
//nIndex2 = 31;从右往左查找,并反向给出索引值
TCHAR szPath[MAX_PATH];
::GetModuleFileName(NULL, szPath, MAX_PATH);
CString szCurrentDirectory = (CString)szPath;
::AfxMessageBox(szCurrentDirectory);
int nIndex = szCurrentDirectory.Find('\\');
CString szTemp;
szTemp.Format("%d",nIndex);
::AfxMessageBox(szTemp);
szCurrentDirectory = szCurrentDirectory.Left(szCurrentDirectory.ReverseFind('\\'));
::AfxMessageBox(szCurrentDirectory);