zoukankan      html  css  js  c++  java
  • Win32 配置文件用法

    #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 ;
    }

  • 相关阅读:
    运行级别和root密码找回
    磁盘情况查询
    linux磁盘分区、挂载
    三、本地负载均衡器与openfeign声明式客户端
    二、Nacos服务注册与发现
    一、微服务架构演变过程
    shell工具
    Netty概述
    垃圾回收概述及算法
    执行引擎
  • 原文地址:https://www.cnblogs.com/UnGeek/p/3574281.html
Copyright © 2011-2022 走看看