记事本内存的是绝对路径。 TxtContent只读到了一个盘符D。 哪位仁兄帮帮忙。
CString ConfigFilePath = TEXT("config\\config.txt");
CString TxtContent;
try
{
CStdioFile file(ConfigFilePath, CFile::modeReadWrite);
CString strLine;
while (file.ReadString(strLine))
{
TxtContent.Append(strLine);
}
file.Close();
}
catch (CFileException* e)
{
e->ReportError();
e->Delete();
}