| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 557 人关注过本帖
标题:请问?VB如何打开List1里显示的路劲!
只看楼主 加入收藏
事业男儿
Rank: 2
等 级:论坛游民
帖 子:317
专家分:14
注 册:2007-4-25
结帖率:82.19%
收藏
已结贴  问题点数:20 回复次数:2 
请问?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
砖家的谎言
Rank: 12Rank: 12Rank: 12
等 级:禁止访问
威 望:30
帖 子:693
专家分:3898
注 册:2013-12-6
收藏
得分:10 
这个就不会了

我不是砖家,要努力成为砖家。
2015-01-31 11:15
wp231957
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:神界
等 级:贵宾
威 望:423
帖 子:13688
专家分:53332
注 册:2012-10-18
收藏
得分:10 
使用filelist控件

DO IT YOURSELF !
2015-01-31 11:56
快速回复:请问?VB如何打开List1里显示的路劲!
数据加载中...
 
   



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

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