文件流 if(0 != access(lpszFilePath, 0)); { return; } //inFile来自fstream,ifstream为输入文件流(从文件读入) std::ifstream inFile(lpszFilePath, std::ios::in); std::string strLineStr; while(std::getline(inFile, strLineStr)) { //返回字符串中从p开始的n个字符的拷贝 std::string::substr(p,n); }