ReadString和WriteString

CStdioFile SFile;

CString csReadString;
CString csBrowseFileName = OpenDialog(); //打开文件对话框,选择打开的文件

if(csBrowseFileName == "")
return;
else
SFile.Open(csBrowseFileName, CFile::modeRead);
while(SFile.ReadString(csReadString)) //ReadString每次读取一行

{

for(int i = 0; i < 4; i++)
{
AfxExtractSubString(csExtractString, csReadString, i, ' ');
if(i != 0)
{
dExtractString = _ttol(csExtractString);
vLatLonHgt.push_back(dExtractString);
}
}

}




CStdioFile SFile;
CString csSaveFileName = SaveDialog(); 打开保存对话框,选择文件保存的路径


if(csSaveFileName == "")
return;

SFile.Open(csSaveFileName, CFile::modeCreate | CFile::modeWrite);

SFile.WriteString("hello");

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页