کد PHP:
Option Explicit
Private Sub cmdStart_Click()
Static Running As Boolean
Dim next_dir As Integer
Dim dir_name As String
Dim sub_dir As String
Dim i As Integer
Dim txt As String
If Right(StartText.Text, 1) = "" Then
StartText.Text = Left(StartText, Len(StartText.Text) – 1)
End If
If Running Then
Running = False
cmdStart.Caption = "Start"
Else
Running = True
MousePointer = vbHourglass
cmdStart.Caption = "Stop"
List1.Clear
DoEvents
next_dir = 1
List1.AddItem StartText.Text
Do While next_dir <= List1.ListCount
'Get the next directory to search
dir_name = List1.List(next_dir – 1)
next_dir = next_dir + 1
sub_dir = Dir(dir_name & "*", vbDirectory)
Do While sub_dir <> ""
'Add the name to the list
it is a directory
If UCase(sub_dir) <> "PAGEFILE.SYS" And sub_dir <> "." And sub_dir <> ".." Then
sub_dir = dir_name & "" & sub_dir
On Error Resume Next
If GetAttr(sub_dir) And vbDirectory Then List1.AddItem sub_dir
DoEvents
End If
sub_dir = Dir(, vbDirectory)
Loop
DoEvents
If Not Running Then Exit Do
Loop
End If
MousePointer = vbDefault
cmdStart.Caption = "Start"
Running = False
End Sub
علاقه مندی ها (Bookmarks)