I am going to develop a antivirus software and i want to scan the files..
so i want to get the files one by one into a Label
I Already use this code to get add the files to a listbox But It did not Help For me...
Because it is adding Whole Files to a List Box at Ones..
If Enyone Know How To Do this.. Please Help Me..
I Been Searching For this Since last Month.. Thanks..
so i want to get the files one by one into a Label
I Already use this code to get add the files to a listbox But It did not Help For me...
Because it is adding Whole Files to a List Box at Ones..
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
rslts = New List(Of String)
foo(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
ListBox1.Items.Clear()
ListBox1.Items.AddRange(rslts.ToArray)
End Sub
Dim rslts As List(Of String)
Private Sub foo(ByVal aDir As String)
Try
Dim di As New IO.DirectoryInfo(aDir)
Dim aryFiles() As IO.FileInfo = di.GetFiles("*.*")
Dim aryDirs() As IO.DirectoryInfo = di.GetDirectories()
For Each fi As IO.FileInfo In aryFiles
rslts.Add(fi.FullName)
Next
For Each d As IO.DirectoryInfo In aryDirs
foo(d.FullName)
Next
Catch ex As Exception
End Try
End Sub
If Enyone Know How To Do this.. Please Help Me..
I Been Searching For this Since last Month.. Thanks..
Last edited by a moderator: