作者smallsafe (拉傷了 QQ)
看板Visual_Basic
標題[VB6 ] 檔案怎麼照時間排序?
時間Sat Sep 4 11:38:43 2010
使用物件 command button 和 list box
我想搜尋檔案後,依照日期和時間排序,請問要怎麼寫呢?
我的程式
Dim p, As String
p = Dir("C:\*.*")
Do Until p = ""
DoEvents
List1.AddItem p
p = Dir
Loop
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then
Print List1.List(i)
End If
Next
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.204.215.155
※ 編輯: smallsafe 來自: 123.204.215.155 (09/04 11:40)
1F:→ MOONRAKER:dir()不回傳日期時間資訊,所以你要想別的辦法取得目錄 09/04 17:17
2F:→ MOONRAKER:可以考慮shell()。 09/04 17:17