首页 > Windows开发 > 详细

Win32 配置文件用法

时间:2014-03-01 10:29:27      阅读:512      评论:0      收藏:0      [点我收藏+]

#include "stdafx.h"
#include <Shlobj.h>
#include <Shlwapi.h>

#pragma comment(lib, "Shlwapi.lib")
int _tmain()
{
    TCHAR szPath[MAX_PATH];

    if(S_OK==SHGetFolderPath(NULL,
        CSIDL_PERSONAL|CSIDL_FLAG_CREATE,
        NULL,
        0,
        szPath))
    {
        //PathAppend(szPath, TEXT("New Doc.txt"));
        //HANDLE hFile = CreateFile(szPath, ...);
        
        
        
    }
    StrCat(szPath,_T("\\hello.ini"));
    //GetPrivateProfileSectionNames(szPath,MAX_PATH,);
    //MessageBoxW(NULL,szPath,0,0);
    OutputDebugString(szPath);
    ::WritePrivateProfileStringW(_T("INFO"),_T("NAME"),_T("hello"),szPath);
    ::WritePrivateProfileStringW(_T("MONEY"),_T("COUNT"),_T("10"),szPath);
    TCHAR szBuff[1024];
    GetPrivateProfileSectionNames(szBuff,MAX_PATH,szPath);
    int i = 0;
    do
    {
        if (szBuff[i])
        {
            OutputDebugString(szBuff+i);
            while(szBuff[++i]);
        }
    } while (szBuff[++i]);
    return 0 ;
}

Win32 配置文件用法,布布扣,bubuko.com

Win32 配置文件用法

原文:http://www.cnblogs.com/UnGeek/p/3574281.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!