满意答案
RUI14
2013.08.15
采纳率:40% 等级:12
已帮助:7349人
写ini
void CMyIniDlg::OnButton2()
{
// TODO: Add your control notification handler code here
CString str;
GetDlgItem(IDC_EDIT1)->GetWindowText(str);
if (str=="") return;
::WritePrivateProfileString("MyTest","Name",str,"Set.ini");
AfxMessageBox(str);
}
读ini
void CMyIniDlg::OnButton4()
{
// TODO: Add your control notification handler code here
CString str;
GetPrivateProfileString("MyTest","Name","用户名",str.GetBuffer(MAX_PATH),MAX_PATH,"Set.ini");
AfxMessageBox(str);
}
00分享举报