⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inimodule.bas

📁 主要功能如题
💻 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 + -