g strCmdLine = mandLine();Р?int totalLen = strCmdLine.GetLength();Р?int i = 0;Р?int index = 0;//循环统计字符个数Р?for (i = 0,index = 0; i < 3; i++,index ++)Р?{Р index = strCmdLine.Find("\"", index); //查找字符串Р?}Р?if (index != 0)Р?{Р for (i = index;i < totalLen - 1;i ++)Р SavePath += strCmdLine.GetAt(i);Р int n = SavePath.ReverseFind('.'); Р CString stl = SavePath.Right(SavePath.GetLength() - n - 1);Р if (stl == "txt" || stl == "TXT" || stl == "c" || stl == "C" || stl == "cpp" || stl == "CPP"Р || stl == "h" || stl == "H" || stl == "xml" || stl == "XML" || stl == "html" || stl == "HTML")Р {Р CString strText;Р CFile file(SavePath,CFile::modeReadWrite); //以读与写方式打开文件Р char read[50000];Р file.Read(read,50000); //读取文件内容Р for(unsigned i=0;i<file.GetLength();i++)Р {Р strText += read[i];//把文件内容赋值给CString变量Р }