为了账号安全,请及时绑定邮箱和手机立即绑定

VB Combo循环加载INI文件?

VB Combo循环加载INI文件?

跃然一笑 2019-04-09 10:06:21
VB Combo循环加载INI文件
查看完整描述

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

查看完整回答
反对 回复 2019-04-13
?
哔哔one

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

'你附加那里没看明白你想表达什么.



查看完整回答
反对 回复 2019-04-13
  • 3 回答
  • 0 关注
  • 988 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信