void CFileTextDoc::OnIniread()
{
// TODO: Add your command handler code here
CString strStudName;
 
int nStudAge;
 
GetPrivateProfileString("Info","Name","默认姓名",strStudName.GetBuffer(MAX_PATH),MAX_PATH,"./student.ini");
 
//读入整型值
nStudAge = GetPrivateProfileInt("Info","Age",10,"./student.ini");
CString strAge;
strAge.Format("%d",nStudAge);
 
MessageBox(NULL,strStudName,_T(""),MB_OK);
 
MessageBox(NULL,strAge,_T(""),MB_OK);
}
 
//将信息写入.ini文件中
void CFileTextDoc::OnIniwrite()
{
// TODO: Add your command handler code here
CString strName,strTemp;
 
int nAge;
 
strName="张三";
 
nAge=12;
 
WritePrivateProfileString("Info","Name",strName,"./student.ini");
 
strTemp.Format("%d",nAge);
 
WritePrivateProfileString("Info","Age",strTemp,"./student.ini");
 
WritePrivateProfileString("Info","Sex","男","./student.ini");
 
WritePrivateProfileString("Record","Male","女","./student.ini");
 
MessageBox(NULL,"文件写入成功!",_T(""),MB_OK);
   
}

最新文章

  1. JMeter学习(三十四)测试报告优化
  2. UOJ25——IOI2014Wall
  3. Wireshark工具创建过滤器的方式
  4. ubuntu /etc/network/interfaces 中配置虚拟链路
  5. Data Pump(数据抽取)介绍
  6. Spring Boot 探索系列 - 自动化配置篇
  7. hdu2665-Kth number
  8. js中年份、月份下拉框
  9. 团队作业4——第一次项目冲刺 fOURth DaY
  10. 《Spark Python API 官方文档中文版》 之 pyspark.sql (一)
  11. linux下 ls -l 命令显示结果每一列代表什么意思
  12. [BZOJ 4419][Shoi2013]发微博
  13. 【转载】xilinx 高速收发器Serdes深入研究
  14. flock
  15. ORA-08104
  16. python序列(列表,元组,字典)的增删改查
  17. MySQL 5.7临时表空间
  18. ADB not responding
  19. [django]django缓存
  20. 【CSS小技巧】 用 CSS 实现一个宽高等比自适应容器

热门文章

  1. Unity 对象池的使用
  2. WebSphere之wasprofile.sh使用
  3. .NET基础拾遗(6)特性
  4. 简单JS多级下拉框无刷新
  5. oracle服务的开始和关闭 CMD
  6. 《第一行代码》学习笔记10-活动Activity(8)
  7. performSelector的方法
  8. JAVA 对象引用,以及对象赋值(转)
  9. Python核心编程(第七章)--映像和集合类型
  10. Hdu1092