/// ReadFile.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//--------------------------------------------------------------------------
/// strip 函数在博客“C++:strip函数以及读取ini配置文件”中,这里不再赘述
//--------------------------------------------------------------------------
#include "pch.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
//删除ini配置文件的key
void deleteKey_INI_File(string file_path, string name, string title, string key)
{
ifstream i(file_path + "\\" + name);
vector<string> lines;
bool match_title = false;
if (i.is_open())
{
while (!i.eof())
{
string line;
getline(i, line);
//初步清洗
strip(line);
//二次清洗
if (line[0] == ';')
{
lines.push_back(line);
}//注释不处理
C++:删除ini配置文件中的键值(key)
最新推荐文章于 2023-03-10 15:19:26 发布
本文介绍如何使用C++编程语言从ini配置文件中删除指定的键值(key)。内容涵盖解析ini文件,查找键并进行删除的相关步骤和注意事项。
摘要由CSDN通过智能技术生成