VB Combo循环加载INI文件?

VB Combo循环加载INI文件


跃然一笑
浏览 995回答 3
3回答

临摹微笑

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 IntegerPrivate Declare Function icePub_getIniValue Lib "icePubDll.dll" (ByVal valDefaultValue As Integer, ByVal strGroupName As String, ByVal strKeyName As String, ByVal strIniFilename As String) As IntegerPrivate Declare Function icePub_setIniString Lib "icePubDll.dll" (ByVal strValue As String, ByVal strGroupName As String, ByVal strKeyName As String, ByVal strIniFilename As String) As IntegerDim val2 As IntegerDim strVal As StringFor i = 1 To 5keyName = 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

哔哔one

假如INI的内容为:[Section1]Key1=111Key2=222Key3=333[Section]Key1=111Key2=222Key3=333[Section2]Key1=111Key2=222Key3=333Private Sub Combo1_Click()Text1 = Mid(Combo1.Text, 6, Combo1.ListCount)End SubPrivate Sub Command1_Click()Open "C:\Documents and Settings\MoBin\桌面\a.ini" For Input As #1 '你自己改一下你的ini的路径Do While Not EOF(1)Line Input #1, iniIf ini = "[Section]" ThenDoLine Input #1, ini1Combo1.AddItem ini1Loop While (Left(ini1, 3) = "Key")Combo1.RemoveItem Combo1.ListCount - 1Combo1.Text = Combo1.List(0)Exit DoEnd IfLoopClose #1End Sub'你附加那里没看明白你想表达什么.
打开App,查看更多内容
随时随地看视频慕课网APP