eg:比如要读取 d:\haha\a.ini里面的 [options]节点下的FileName就这样写:
字串4
strA=GetProfile("d:\haha\a.ini","options","FileName") 字串9
定义GetProfile函数
Function GetProfile(strFileName As String, strSection As String, strName As String) As String 字串4
strSectionTemp = ""
strNameTemp = ""
strreturn = ""
On Error GoTo ErrReadFile
Open strFileName For Input As #1
'查询节点 字串9
Do While Not EOF(1)
strCharA = Input(1, #1)
If strCharA = "[" Then
Do While Not EOF(1)
strCharB = Input(1, #1)
If strCharB = "]" Then Exit Do
字串2
字串1
定义标签 字串5
aa: 字串8
strNameTemp = ""
Do While Not EOF(1)
strCharA = Input(1, #1)
If strCharA <> "=" Then
strNameTemp = strNameTemp & strCharA 'gained name
Else
Exit Do
字串7
字串6

| 最新评论: |