雖然VB
Function sdGetIniInfo(ByVal iniFile As String
If Not File
Return
Exit Function
End If
Dim iniRead As New StreamReader(iniFile)
Dim iniStr As String = iniRead
Dim i As Integer
Dim cLine As Integer
Dim noSec As Boolean = False
Dim getValue As String =
Dim cLst
cLst = iniStr
cLine = UBound(cLst)
For i =
If cLst(i)
If cLst(i)
noSec = True
getValue = cLst(i)
Exit For
End If
End If
Next
If noSec = True Then
Return getValue
Else
Return
End If
End Function
說明
EG:
set
[Info]
name=zhuang
age=
Private Sub Button
Dim name As String
name = sdGetIniInfo(Application
MsgBox(name)
End Sub
From:http://tw.wingwit.com/Article/program/ASP/201311/21664.html