如题所述
å»ºè®®ä½ å°ä¿¡æ¯åå¨æ件æ注å表ä¸ï¼ç¶åç¨ä¸ªå¾ªç¯è¯»å并å è½½ãè¿æ ·ä»¥åä¹å¥½ä¿®æ¹ã
å¸®ä½ ä¿®æ¹äºä¸ï¼å°è·¯å¾æ以ä¸æ ¼å¼å为txtæ件ã
åé©å²online
D:\ç大ç½ç»\åé©å²online\maplestory.exe
è¶ çº§ç丽
D:\ZSNESW\è¿è¡æ¸¸æ.exe
æºæ¢°è¿·å
D:\æºæ¢°è¿·å\machinarium.exe
æ¤ç©å¤§æåµå°¸
D:\Plants vs. Zombies\PlantsVsZombies.exe
平衡ç
D:\Ballance\Startup.exe
ç²ç²ä¸ç
D:\æ°å»ºæ件夹\World of Goo V1.4\WorldOfGoo.exe
Private Sub Label1_Click(Index As Integer)
Select Case Index
Case 0
LoadData ("Games.txt")
Case 1
LoadData ("Tools.txt")
Case 2
...
End Select
End Sub
Private Sub LoadData(TxtFile As String)
Dim str As String, Data() As String
Dim Names() As String, Paths() As String
Dim i As Long, k As Long
'æå¼æ件,读åå 容
Open TxtFile For Binary As #1
str = Input(LOF(1), #1)
Close #1
Data() = Split(str, vbCrLf)
ReDim Names(0 To Int(UBound(Data) / 2))
ReDim Paths(0 To Int(UBound(Data) / 2))
k = 0
For i = 0 To UBound(Data) Step 2
'ç¡®ä¿ä¸ä¸ºç©º
If Len(Data(i)) <> 0 And Len(Data(i + 1)) <> 0 Then
Names(k) = Data(i)
Paths(k) = Data(i + 1)
'æ·»å å¾æ
Dim a
Picture1.Picture = LoadPicture("")
a = ExtractIcon(App.hInstance, Paths(k), 0)
a = DrawIcon(Picture1.hdc, 0, 0, a)
ImageList1.ListImages.Add , , Picture1.Image
'æ·»å 项ç®,å©ç¨keyå±æ§å¨åè·¯å¾æ°æ®
ListView1.ListItems.Add , Paths(k), Names(k), k + 1
k = k + 1
End If
Next i
End Sub
'åå»
Private Sub ListView1_DblClick()
'å¤ææ¯å¦ç¹å»å°item
If Not ListView1.SelectedItem Is Nothing Then
Shell ListView1.SelectedItem.Key
End If
End Sub
'为äºè®©Listviewå¨æ²¡ç¹å°itemæ¶å¤±å»ç¦ç¹
'å¦åç¹ç©ºç½æ¶selectitemä¸ä¸ºç©º
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Not ListView1.HitTest(x, y) Is ListView1.SelectedItem Then
Set ListView1.SelectedItem = Nothing
End If
End Sub
å¸®ä½ ä¿®æ¹äºä¸ï¼å°è·¯å¾æ以ä¸æ ¼å¼å为txtæ件ã
åé©å²online
D:\ç大ç½ç»\åé©å²online\maplestory.exe
è¶ çº§ç丽
D:\ZSNESW\è¿è¡æ¸¸æ.exe
æºæ¢°è¿·å
D:\æºæ¢°è¿·å\machinarium.exe
æ¤ç©å¤§æåµå°¸
D:\Plants vs. Zombies\PlantsVsZombies.exe
平衡ç
D:\Ballance\Startup.exe
ç²ç²ä¸ç
D:\æ°å»ºæ件夹\World of Goo V1.4\WorldOfGoo.exe
Private Sub Label1_Click(Index As Integer)
Select Case Index
Case 0
LoadData ("Games.txt")
Case 1
LoadData ("Tools.txt")
Case 2
...
End Select
End Sub
Private Sub LoadData(TxtFile As String)
Dim str As String, Data() As String
Dim Names() As String, Paths() As String
Dim i As Long, k As Long
'æå¼æ件,读åå 容
Open TxtFile For Binary As #1
str = Input(LOF(1), #1)
Close #1
Data() = Split(str, vbCrLf)
ReDim Names(0 To Int(UBound(Data) / 2))
ReDim Paths(0 To Int(UBound(Data) / 2))
k = 0
For i = 0 To UBound(Data) Step 2
'ç¡®ä¿ä¸ä¸ºç©º
If Len(Data(i)) <> 0 And Len(Data(i + 1)) <> 0 Then
Names(k) = Data(i)
Paths(k) = Data(i + 1)
'æ·»å å¾æ
Dim a
Picture1.Picture = LoadPicture("")
a = ExtractIcon(App.hInstance, Paths(k), 0)
a = DrawIcon(Picture1.hdc, 0, 0, a)
ImageList1.ListImages.Add , , Picture1.Image
'æ·»å 项ç®,å©ç¨keyå±æ§å¨åè·¯å¾æ°æ®
ListView1.ListItems.Add , Paths(k), Names(k), k + 1
k = k + 1
End If
Next i
End Sub
'åå»
Private Sub ListView1_DblClick()
'å¤ææ¯å¦ç¹å»å°item
If Not ListView1.SelectedItem Is Nothing Then
Shell ListView1.SelectedItem.Key
End If
End Sub
'为äºè®©Listviewå¨æ²¡ç¹å°itemæ¶å¤±å»ç¦ç¹
'å¦åç¹ç©ºç½æ¶selectitemä¸ä¸ºç©º
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Not ListView1.HitTest(x, y) Is ListView1.SelectedItem Then
Set ListView1.SelectedItem = Nothing
End If
End Sub
温馨提示:答案为网友推荐,仅供参考