´————————(1)————————————
´获得指定ini文件中某个节下面的所有键值 TrueZq,,需要下面的API声明
´Private Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
´返回一个字符串数组
´调用举例:
´Dim arrClass() As String
´arrClass = GetInfoSection("class", "d:\type.ini")
Public Function GetInfoSection(strSection As String, strIniFile As String) As String()
Dim strReturn As String * 32767
Dim strTmp As String
Dim nStart As Integer, nEnd As Integer, i As Integer
Dim sArray() As String
Call GetPrivateProfileSection(strSection, strReturn, Len(strReturn), strIniFile)
strTmp = strReturn
i = 1
Do While strTmp <> ""
nStart = nEnd + 1
nEnd = InStr(nStart, strReturn, vbNullChar)
strTmp = Mid$(strReturn, nStart, nEnd - nStart)
If Len(strTmp) > 0 Then
ReDim Preserve sArray(1 To i)
sArray(i) = strTmp
i = i + 1
End If
Loop
GetInfoSection = sArray
End Function
【VB下几个非常有用的函数】相关文章:
2025年外省高中学业水平合格性考试成绩转入江苏认定的通告公布05-07
Vb中控件的自动排列05-07
写未来的作文300字05-07
Our Mother Is the Same 我们的妈妈是一样的05-07
小学父爱的作文600字05-07
汪涵讲述小时候成长经历:鸡毛掸子的故事05-07
关于清明节的英语作文:清明节05-07
盐阜大众报报业集团(盐城)公开招聘《东方生活报》编辑记者的公告 2月25日到3月3日报名05-07
