3 回答
TA贡献1982条经验 获得超2个赞
Private Declare Function icePub_getIniString Lib "icePubDll.dll" (ByVal strDefaultValue As String, ByVal strGroupName As String, ByVal strKeyName As String, ByVal strIniFilename As String, ByVal strResult As String) As Integer
Private Declare Function icePub_getIniValue Lib "icePubDll.dll" (ByVal valDefaultValue As Integer, ByVal strGroupName As String, ByVal strKeyName As String, ByVal strIniFilename As String) As Integer
Private Declare Function icePub_setIniString Lib "icePubDll.dll" (ByVal strValue As String, ByVal strGroupName As String, ByVal strKeyName As String, ByVal strIniFilename As String) As Integer
Dim val2 As Integer
Dim strVal As String
For i = 1 To 5
keyName = Key + Trim(Str(i))
'值
val2 = icePub_getIniValue(0, "Section", keyName, App.Path + "\myini.ini")
'串
strVal = icePub_getIniValue(0, "Section", keyName, App.Path + "\myini.ini")
'往Combo1里添加
Next i
'写
a = icePub_setIniString("555", "Section", "Key1", App.Path + "\myini.ini")
http://zhidao.baidu.com/question/139238142.html
里边下载的rar包里有dll
TA贡献1854条经验 获得超8个赞
假如INI的内容为:
[Section1]
Key1=111
Key2=222
Key3=333
[Section]
Key1=111
Key2=222
Key3=333
[Section2]
Key1=111
Key2=222
Key3=333
Private Sub Combo1_Click()
Text1 = Mid(Combo1.Text, 6, Combo1.ListCount)
End Sub
Private Sub Command1_Click()
Open "C:\Documents and Settings\MoBin\桌面\a.ini" For Input As #1 '你自己改一下你的ini的路径
Do While Not EOF(1)
Line Input #1, ini
If ini = "[Section]" Then
Do
Line Input #1, ini1
Combo1.AddItem ini1
Loop While (Left(ini1, 3) = "Key")
Combo1.RemoveItem Combo1.ListCount - 1
Combo1.Text = Combo1.List(0)
Exit Do
End If
Loop
Close #1
End Sub
'你附加那里没看明白你想表达什么.
- 3 回答
- 0 关注
- 1049 浏览
添加回答
举报