Option Explicit
'read
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedString As String, _
ByVal nSize As Long, _
ByVal lpFileName As String) As Long
'write
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As String, _
ByVal lpString As String, _
ByVal lpFileName As String) As Long Sub Read()
Dim Rec As String
Dim NC As Long Rec = String(255, 0)
NC = GetPrivateProfileString("BOOT", "Shell", "", Rec, 255, "D:\test.ini")
MsgBox Rec End Sub Sub WriteProfile()
Dim NC As Long
NC = WritePrivateProfileString("BOOT", "Shell", "Test1", "D:\test.ini")
End Sub

  

VBA读写ini 配置文件的更多相关文章

  1. C# 读写 ini 配置文件

    虽说 XML 文件越发流行,但精简的 ini 配置文件还是经常会用到,在此留个脚印. 当然,文中只是调用系统API,不会报错,如有必要,也可以直接以流形式读取 ini文件并解析. /// <su ...

  2. [转]VB 读写ini 配置文件

    转自 百度知道 C# 读写 ini配置文件 点此链接 'API 声明Public Declare Function GetPrivateProfileString Lib "kernel32 ...

  3. 自己写的 读写 ini 配置文件类

    /// <summary> /// 不调用系统API 读写 ini 配置文件 /// </summary> public class RW_ini { #region ==== ...

  4. 引用“kernel32”读写ini配置文件

    引用"kernel32"读写ini配置文件 unity ini kernel32 配置文件  引用"kernel32"读写ini配置文件 OverView ke ...

  5. C# 文件的一些基本操作(转)//用C#读写ini配置文件

    C# 文件的一些基本操作 2009-07-19  来自:博客园  字体大小:[大 中 小] 摘要:介绍C#对文件的一些基本操作,读写等. using System;using System.IO;us ...

  6. C#操作读写INI配置文件

    一个完整的INI文件格式由节(section).键(key).值(value)组成.示例如:[section]key1=value1key2=value2; 备注:value的值不要太长,理论上最多不 ...

  7. c#读写ini配置文件示例

    虽然c#里都是添加app.config 并且访问也很方便 ,有时候还是不习惯用他.那么我们来做个仿C++下的那种ini配置文件读写吧     其他人写的都是调用非托管kernel32.dll.我也用过 ...

  8. WritePrivateProfileString等读写.ini配置文件

    配置文件中经常用到ini文件,在VC中其函数分别为: 写入.ini文件: BOOL WritePrivateProfileString( LPCTSTR lpAppName, // INI文件中的一个 ...

  9. C++读写ini配置文件GetPrivateProfileString()&WritePrivateProfileString()

    转载: 1.https://blog.csdn.net/fengbingchun/article/details/6075716 2. 转自:http://hi.baidu.com/andywangc ...

随机推荐

  1. 关于mpi的理论知识以及编写程序来实现数据积分中的梯形积分法。

    几乎所有人的第一个程序是从“hello,world”程序开始学习的 #include "mpi.h" #include <stdio.h> int main(int a ...

  2. 爬虫——BeautifulSoup和Xpath

    爬虫我们大概可以分为三部分:爬取——>解析——>存储 一 Beautiful Soup: Beautiful Soup提供一些简单的.python式的函数用来处理导航.搜索.修改分析树等功 ...

  3. python 运用numpy库与matplotlib库绘制数据图

    代码一 import numpy as np import matplotlib.pyplot as plt x=np.linspace(0,6,100) y=np.cos(2*np.pi*x)*np ...

  4. Java数据类型(Primivite 和引用数据类型!)

    一.byte(8位)  short(16位)  int(32位) long(64位) float(32位) double(64位) boolean(Java虚拟机决定)  true 或者false! ...

  5. Mybatis级联:关联、集合和鉴别器的使用

    Mybatis中级联有关联(association).集合(collection).鉴别器(discriminator)三种.其中,association对应一对一关系.collection对应一对多 ...

  6. 关于 early Z 与 z-prepass

    今天在考虑优化MOBA项目中的树木时(采用了ALPHATEST)时,与同事讨论中深入了解了这两个概念. 以前居然不知道有early z的存在,真是惭愧.... 上个链接: 深入剖析GPU Early ...

  7. 阿里云ossfs配置

    Github:https://github.com/aliyun/ossfs/wiki Root账户卸载:umount /挂载目录非root用户要卸载目录,请用:fusermount -u your_ ...

  8. appium python中的android uiautomator定位

    text定位:driver.find_element_by_android_uiautomator('new UiSelector().text("请输入手机号")') #模糊定位 ...

  9. mysql主从脚本

    #!/bin/bash #auto make install mysql AB Replication #by author ale #-- :: MYSQL_SOFT="mariadb m ...

  10. Object备忘录

    1.Object.assign(target,...source) 方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象.它将返回目标对象. 2.Object.create()方法创建一个新对 ...