标题:请问?VB如何打开List1里显示的路劲!
取消只看楼主
事业男儿
Rank: 2
等 级:论坛游民
帖 子:308
专家分:14
注 册:2007-4-25
结帖率:81.69%
已结贴  问题点数:20 回复次数:0 
请问?VB如何打开List1里显示的路劲!
'读写INI文件
Private Declare Function GetPrivateProfileString Lib "Kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpRetunedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function SaveINI Lib "Kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As String, ByVal lplFileName As String) As Long

'读写INI文件
Function GetINI(AppName As String, KeyName As String, filename As String) As String
   Dim RetStr As String
   RetStr = String(10000, Chr(0))
   GetINI = Left(RetStr, GetPrivateProfileString(AppName, ByVal KeyName, "", RetStr, Len(RetStr), filename))
End Function

Private Sub Command1_Click()
CommonDialog1.Filter = "所有文件(*.*)|*.*"
CommonDialog1.FilterIndex = 1
CommonDialog1.ShowOpen
List1.AddItem CommonDialog1.filename
End Sub
Private Sub Command2_Click()
??????????????????
End Sub

Private Sub Form_Load()
For i = 0 To Val(GetINI("listcount", "Count", App.Path & "\st.ini")) - 1
List1.AddItem GetINI("list", CStr(Format(i, "000")), App.Path & "\st.ini"), i
Next i
End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim i As Integer
For i = 1 To List1.ListCount
SaveINI "list", CStr(Format(i - 1, "000")), List1.List(i - 1), App.Path & "\st.ini"
Next i
SaveINI "ListCount", "Count", List1.ListCount, App.Path & "\st.ini"
End Sub
搜索更多相关主题的帖子: 如何 
2015-01-30 12:59



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-441637-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.129173 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved