在我们写的程序当中,总有一些配置信息需要保存下来,以便完成程序的功能,最简单的办法就是将这些信息写入INI文件中,程序初始化时再读入.具体应用如下:

将信息写入.INI文件中

1.所用的WINAPI函数原型为:
BOOL WritePrivateProfileString(
LPCTSTR lpAppName,
LPCTSTR lpKeyName,
LPCTSTR lpString,
LPCTSTR lpFileName
);
其中各参数的意义
LPCTSTR lpAppName 是INI文件中的一个字段名.
LPCTSTR lpKeyName 是lpAppName下的一个键名,通俗讲就是变量名.
LPCTSTR lpString 是键值,也就是变量的值,不过必须为LPCTSTR型或CString型的.
LPCTSTR lpFileName 是完整的INI文件名,如果没有指定完整路径名,则会在windows目录(默认)查找文件。如果文件没有找到,则函数会在windows目录创建它。

WritePrivateProfileString()的更多相关文章

  1. ::WritePrivateProfileString()的用法,以及GetPrivateProfileString的用法注意事项

    WritePrivateProfileString(_T("Section1"),_T("Field1"),Field,savePath); 函数说明,这是在写 ...

  2. WritePrivateProfileString GetPrivateProfileString 读取写 配置文件

    Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfi ...

  3. WritePrivateProfileString、GetPrivateProfileString 读写配置文件

    WritePrivateProfileString 写配置文件 BOOL WINAPI WritePrivateProfileString( _In_ LPCTSTR lpAppName, _In_ ...

  4. WritePrivateProfileString等读写.ini配置文件

    配置文件中经常用到ini文件,在VC中其函数分别为: 写入.ini文件: BOOL WritePrivateProfileString( LPCTSTR lpAppName, // INI文件中的一个 ...

  5. INI文件,WritePrivateProfileString()和GetPrivateProfileString()函数----转载

    INI文件就是扩展名为“ini”的文件.在Windows系统中,INI文件是很多,最重要的就是“System.ini”.“System32.ini”和“Win.ini”.该文件主要存放用户所做的选择以 ...

  6. C++读写ini配置文件GetPrivateProfileString()&WritePrivateProfileString()

    转载: 1.https://blog.csdn.net/fengbingchun/article/details/6075716 2. 转自:http://hi.baidu.com/andywangc ...

  7. C# ini文件操作【源码下载】

    介绍C#如何对ini文件进行读写操作,C#可以通过调用[kernel32.dll]文件中的 WritePrivateProfileString()和GetPrivateProfileString()函 ...

  8. c#文件操作

    1.创建文件夹 //using System.IO; Directory.CreateDirectory(%%1);   2.创建文件 //using System.IO; File.Create(% ...

  9. Windows API 函数列表 附帮助手册

    所有Windows API函数列表,为了方便查询,也为了大家查找,所以整理一下贡献出来了. 帮助手册:700多个Windows API的函数手册 免费下载 API之网络函数 API之消息函数 API之 ...

随机推荐

  1. 获取Ad用户信息

    private];                }                dt.Rows.Add(dr);            }            return dt;        ...

  2. POJ 2418

    http://poj.org/problem?id=2418 这是一个二叉树的题目,但我看了下书,还是不是特别理解会用二叉树,所以我就用其他的办法来做,结果一样AC,时间也就1700多ms,比起二叉树 ...

  3. 47. 数组中出现次数超过一半的数字[Number appears more than half times]

    [题目]:数组中有一个数字出现的次数超过了数组长度的一半,找出这个数字. 例如长度为9的数组{1,2,3,2,2,2,5,4,2}中次数超过了数组长度的一半的数字为2,而长度为8的数组{1,2,3,2 ...

  4. Java for LeetCode 041 First Missing Positive

    Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] ...

  5. Could not create the view: An unexpected exception was thrown. 电脑突然断电,myeclipse非正常关闭,出现错误

    电脑突然断电,myeclipse非正常关闭,“Package Explorer”非正常显示,出现错误“Could not create the view: An unexpected exceptio ...

  6. WampServer phpadmin apache You don't have permission to access

    1.Forbidden You don't have permission to access / on this server. 后来咨询了一下朋友(php高手),说修改一下php的配置文件http ...

  7. SPI的通信试验 --verilog (从机-全双工)

    SPI的 有关知识参考FPGA作为主机的通信实验. 本实验中FPGA作为从机通过SPI与MCU等通信的试验,可以在时钟上升沿接收数据并且在时钟下降沿发送数据,模仿全双工模式.接收的 数据作为地址,通过 ...

  8. 【转】Quartus II调用modelsim无缝仿真

    Quartus II调用modelsim无缝仿真  ★emouse 思·睿博客文章★ 原创文章转载请注明:http://emouse.cnblogs.com 本篇文章为转载,写的不错,最近在学mode ...

  9. iOS开发网络篇—GET请求和POST请求(转)

    一.GET请求和POST请求简单说明 创建GET请求 1 // 1.设置请求路径 2 NSString *urlStr=[NSString stringWithFormat:@"http:/ ...

  10. vagrant,流浪汉,我又来啦。

    最近学个DEVOPS2.0,讲微服务,容器华,持续部署,很到位,就一个一个工具撸一撸... vagrant,以前接触过,所以上手快,,哈哈,,用时再具体配置. virtualbox的. 基本命令: # ...