请问?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