WritePrivateProfileString
就可以了,或者
AfxGetApp()->WriteProfileString

解决方案 »

  1.   

    BOOL WritePrivateProfileString(
      LPCTSTR lpAppName,
      LPCTSTR lpKeyName,
      LPCTSTR lpString,
      LPCTSTR lpFileName
    );
    [xxx]
    123=WANGYONGWritePrivateProfileString("xxx", "123", "WANGYONG", "文件名")
      

  2.   

    CString cPath;
    CString strValue = _T("");
    GetDlgItemText(IDC_EDIT1,strValue);
    cPath+=".\\win.ini";
    BOOL a = WritePrivateProfileString(TEXT("SUCCEED"),TEXT("Andy.Zhang"),strValue,cPath);
    if (a)
    {
    MessageBox("Write Succeed!");
    }
    else
    MessageBox("Write False!");