CString GetFileDir(const CString& csFile)

CString GetFileDir(const CString& csFile)
{
	int nLen = csFile.GetLength();
	for(int i=0; nLen-1; i>=0; i--)
	{
		if(csFile[i]=='\\'||csFile[i]=='/')
		{
			return csFile.Left(i+1);
		}
	}

	return "";
}
Technorati Tags: MFC windows ansi
posted @ 2011-05-24 11:12  麦峰强  阅读(406)  评论(0编辑  收藏  举报