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

📄 zinimgmt.bas

📁 快速数据库的编程实现 一定要用微软的数据引擎吗?一定要承受巨大的 DLL 文件?本程序说: No.
💻 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 + -