如何使用Borland C ++ 6.0读取和写入INI文件? [英] How to reading and writing INI files using borland C++ 6.0?

查看:95
本文介绍了如何使用Borland C ++ 6.0读取和写入INI文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以给我或提供有关如何使用borland C ++ 6创建和读取ini文件的链接.我继承了一些用C ++ borland 6开发的应用程序,该应用程序可以读写注册表和我的老板希望将其更改为ini文件或其他方法.我只能想到ini文件,但是任何文件都可以.
有人可以帮我吗?

Can anyone give me or provide me with a link as to how to use to create and read an ini file in borland C++ 6. I have inherited some applications developed in C++ borland 6 that read and write to the registry and my boss wants that to change to ini files or another method. I can only think of ini files, but any files will do.
Can anyone help me?

推荐答案

看看这篇文章,代码是平台无关的,因此它应该适合您的目的:

http://www.codeguru.com/Cpp/misc/misc/article.php/c233 / [^ ]
take look at this article the code is plaform independent as such it should suite your purposes:

http://www.codeguru.com/Cpp/misc/misc/article.php/c233/[^]


我会使用XML文件.查看这篇文章.我是为C ++/MFC编写的,但您应该能够轻松地使其适应Borland C ++.

XML应用程序配置文件类 [
I would use XML files. Check out this article. I wrote it for C++/MFC, but you should be able to adapt it to Borland C++ easily enough.

XML Application Profile Class[^]


您可以使用Windows API函数读取/写入INI文件,例如WritePrivateProfileString.
您可能会在
此MSDN页面的底部中找到列出的功能 [ ^ ].
作为文档页面的备注:

You may read/write INI files using Windows API functions like WritePrivateProfileString.
You may find such functions listed at the bottom of this MSDN page[^].
As the documentation page remarks:

提供这些功能仅是为了与Windows的16位版本兼容.新应用程序应使用注册表.
These functions are provided only for compatibility with 16-bit versions of Windows. New applications should use the registry.










这篇关于如何使用Borland C ++ 6.0读取和写入INI文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆