📄 inimodule.bas
字号:
Attribute VB_Name = "IniModule"
Public Declare Function GetPrivateProfileString Lib "kernel32" _
Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, _
ByVal lpKeyName As Any, ByVal lpDefault As String, _
ByVal lpReturnedString As String, ByVal nSize As Long, _
ByVal lpFileName As String) As Long
Public Declare Function WritePrivateProfileString Lib "kernel32" _
Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, _
ByVal lpKeyName As Any, ByVal lpString As Any, _
ByVal lpFileName As String) As Long
'读INI文件
Public Function ReadIni(ByVal AppName As String, ByVal KeyName As String, ByVal FileName As String) As String
Dim ret As Long
Dim buff As String
buff = Space(255)
ret = GetPrivateProfileString(AppName, KeyName, "", buff, 256, FileName)
ReadIni = Trim(buff)
End Function
'写INI文件
Public Function WriteIni(ByVal AppName As String, ByVal KeyName As String, ByVal strValue As String, ByVal FileName As String) As Long
Dim ret As Long
Dim buff As String
buff = strValue
ret = WritePrivateProfileString(AppName, KeyName, buff, FileName)
WriteIni = ret
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -