在MFC中如果直接使用::WritePrivateProfileString("section","name","value","setting.ini")系统默认将setting.ini文件保存在c盘根目录下,如果想要将setting.ini文件保存在当前程序所在目录中,需要在setting前加“.//”,即: ::WritePrivateProfileString("section","name","value",".//setting.ini")