[译]扫描并合并INI文件
By robot-v1.0
本文链接 https://www.kyfws.com/applications/scan-and-merge-ini-files-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 3 分钟阅读 - 1008 个词 阅读量 0[译]扫描并合并INI文件
原文地址:https://www.codeproject.com/Articles/572/Scan-and-Merge-INI-Files
原文作者:Phil McGahan
译文由本站 robot-v1.0 翻译
前言
A free tool to merge INI files, check for common INI file mistakes, and quickly determine how two INI files differ.
一个免费的工具,用于合并INI文件,检查常见的INI文件错误并快速确定两个INI文件之间的差异.
介绍(Introduction)
该实用程序是在深夜在客户站点上编写的,目的是帮助确定在正确配置的计算机上和未正确执行应用程序的计算机上的INI设置之间的差异.最初,它只是对两个INI文件进行了排序,因此可以轻松地使用它们进行比较(This utility was written late at night at a customer site to help medetermine the difference between INI settings on a machine that wasconfigured correctly and a machine that was not executing an applicationcorrectly. Originally, it just sorted two INI files so that they could easily becompared using) Windiff.exe
.(.)
它已被扩展以执行以下附加任务:(It has been expanded to do the following additional tasks:)
- 查找与INI文件中的注释字段有关的语法错误.(Find syntax errors related to comment fields in an INI file.)
- 在INI文件中查找重复的节块.(Find duplicate section blocks in an INI file.)
- 在INI文件的节块中查找重复的键.(Find duplicate keys within section blocks of an INI file.)
- 排序INI文件,以便您可以使用(Sort INI files so that you can use)
Windiff.exe
看看它们有何不同.(to see how they differ.) - 将两个INI文件合并到第三个文件中.(Merge two INI files into a third.)
- 替换系统路径,例如(Replace system paths like)
"C:\Windows\"
与(with)"C:\Winnt\"
在适当的时候.(when it is appropriate.)
如何使用它(How to use it)
只需从命令行运行exe即可查看示例用法和文档.基本格式如下:(Just run the exe from a command line to see example usage and documentation.The basic format is as follows:)
C:\Mytools\MergeINIFiles.exe "C:\DominantFile.INI C:\Suplimental.INI C:\Merged.INI"
因为我们主要通过InstallShield启动此工具,所以没有GUI,除非文件包含错误或参数不正确.(Because we mostly launch this tool via InstallShield, there is no GUI,unless the files contain errors or the parameters are incorrect.)
使用的技术(Technology used)
INI文件被读取为文本文件,因此注释包含在结果集中.该程序很简单,(The INI files are read as text files so that comments are included in theresult set. The program is a simple,) CFile
阅读文字,(reads the text,) CArray
持有文本和(holds the text and) CMap
比较文本.(compares the text.)
概要(Summary)
我对此代码没有任何权利或限制.没有其他来源窃它.该实用程序是使用向导生成的SDIframework编写的.它是使用VC 5.0创建的.(I maintain no rights or restrictions on this code. It was not plagiarizedfrom any other source. This utility was written using a Wizard generated SDIframework. It was created using VC 5.0.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C++ Windows Visual-Studio Dev 新闻 翻译