Win32實現INI檔案的讀寫

2021-05-27 19:19:37 字數 1121 閱讀 6399

// inifile.h: inte***ce for the cinifile class.

////

#if !defined(afx_inifile_h__3d06e4ac_5a93_4d23_84bd_1694e88fdb70__included_)

#define afx_inifile_h__3d06e4ac_5a93_4d23_84bd_1694e88fdb70__included_

#if _msc_ver > 1000

#pragma once

#endif // _msc_ver > 1000

class cinifile 

;#endif // !defined(afx_inifile_h__3d06e4ac_5a93_4d23_84bd_1694e88fdb70__included_)

// inifile.cpp: implementation of the cinifile class.

////

#include "stdafx.h"

#include "inifilevc.h"

#include "inifile.h"

#ifdef _debug

#undef this_file

static char this_file=__file__;

#define new debug_new

#endif

//// construction/destruction

//cinifile::cinifile()

cinifile::~cinifile()

cstring cinifile::getinifilestring(cstring strsection, cstring strkey, cstring strfilename)

void cinifile::setinifileint(cstring strsection, cstring strkey, int value, cstring strfilename)

void cinifile::setinifilestring(cstring strsection, cstring strkey, cstring strvalue, cstring strfilename)

win32實現檔案追加

實現原理 開啟兩個檔案,迴圈讀取要追加的檔案內容,然後寫入到要被追加檔案的末尾 相關api createfile setfilepointerex readfile writefile funname filecat param szexistsfilepath 要被追加的檔案路徑 szaddfil...

Win32 檔案的讀寫操作

檔案的寫操作 writefile 函式的宣告如下 bool writefile handle hfile,lpcvoid lpbuffer,dword nnumberofbytestowrite,lpdword lpnumberofbyteswritten,函式詳情見 實戰 寫入數字 寫入英文本母 ...

Win32 複製檔案

第一種方法 include stdafx.h include include define buf size 256 int tmain int argc,tchar argv hin createfile argv 1 generic read,0,null,open existing,0,nul...