📄 zinimgmt.bas
字号:
Attribute VB_Name = "INIMgmt"
Private Const sizer = 255 * 5 'should be adequate b/c for 4 (255 char) fields and 1 extra to store bytes and tombstone word
Private 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
Private 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
Public Function ReadIndex(ByVal lstrKey As String) As String
On Error Resume Next
Dim lfixedstrRetValue As String * sizer
Dim lstrRetValue As String
Dim lintJunk As Integer
Dim lstrSection As String
lstrSection = "Index"
lfixedstrRetValue = String(sizer, " ")
lintJunk = GetPrivateProfileString(lstrSection, lstrKey, " ", lfixedstrRetValue, sizer, IndexPath)
lstrRetValue = Trim(lfixedstrRetValue)
lstrRetValue = Left(lstrRetValue, Len(lstrRetValue) - 1)
ReadIndex = lstrRetValue
On Error GoTo 0
On Error Resume Next
End Function
Public Sub WriteIndex(ByVal lstrKey As String, ByVal lstrValue As String)
On Error Resume Next
Dim lstrSection As String
Dim lintJunk As Integer
lstrSection = "Index"
lstrValue = Trim(lstrValue)
lintJunk = WritePrivateProfileString(lstrSection, lstrKey, lstrValue, IndexPath)
On Error GoTo 0
On Error Resume Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -