摘要: 原帖:http://leapfish.blog.sohu.com/60685388.html 用Visual C++操作INI文件 在我们写的程序当中,总有一些配置信息需要保存下来,以便完成程序的功能,最简单的办法就是将这些信息写入INI文件中,程序初始化时再读入.具体应用如下: 一.将信息写入.INI文件中. 1.所用的WINAPI函数原型为: BOOL WritePrivatePro... 阅读全文
posted @ 2014-05-14 19:49 lizs 阅读(661) 评论(1) 推荐(0) 编辑
摘要: C++代码//Config.h#pragma once#include #include #include #include #include /** \brief Generic configuration Class**/class Config { // Dataprotected: std::string m_Delimiter; //! m_Contents; //!::... 阅读全文
posted @ 2014-05-14 19:48 lizs 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 字符串库在表string内提供所有函数。它也给字符串设置元表,其中的__index字段指向string表。因此,你可以使用面向对象风格的字符串函数。例如,string.byte(s, i)可写为s:byte(i)。string.byte (s [, i [, j]])返回字符s, s[i+1], ···, s[j]的内部数字代码。i缺省为1;j缺省为i。注意数字代码不一定是跨平台可移植的。stri... 阅读全文
posted @ 2014-05-14 14:51 lizs 阅读(297) 评论(0) 推荐(0) 编辑