I am new in vb. i am working in this program this program run and gives no erro but gives no required result.
Kindly help me
Public
Class Form1
Overloads Function CountFiles(ByVal minSize As Integer, ByVal maxSize As Integer) As Integer
Console.WriteLine(" You have requested the files between " & minSize & "and " & maxSize & " bytes")
Dim files() As String
files = System.IO.Directory.GetFiles("c:\windows")
Dim i, fileCount As Integer
For i = 0 To files.GetUpperBound(0)
Dim FI As New System.IO.FileInfo(files(i))
If FI.Length >= minSize And FI.Length <= maxSize Then
fileCount = fileCount + 1
End If
Next
Return (fileCount)
End Function
Overloads Function CountFiles(ByVal fromDate As Date, ByVal toDate As Date) As Integer
Console.WriteLine(" You have requested the count of files created from" & fromDate & "to" & toDate)
Dim files() As String
files = System.IO.Directory.GetFiles("c:\windows")
Dim i, fileCount As Integer
For i = 0 To files.GetUpperBound(0)
Dim FI As New System.IO.FileInfo(files(i))
If FI.CreationTime.Date >= fromDate And FI.CreationTime.Date <= toDate Then
fileCount = fileCount + 1
End If
Next
Return (fileCount)
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
Kindly help me
Public
Class Form1
Overloads Function CountFiles(ByVal minSize As Integer, ByVal maxSize As Integer) As Integer
Console.WriteLine(" You have requested the files between " & minSize & "and " & maxSize & " bytes")
Dim files() As String
files = System.IO.Directory.GetFiles("c:\windows")
Dim i, fileCount As Integer
For i = 0 To files.GetUpperBound(0)
Dim FI As New System.IO.FileInfo(files(i))
If FI.Length >= minSize And FI.Length <= maxSize Then
fileCount = fileCount + 1
End If
Next
Return (fileCount)
End Function
Overloads Function CountFiles(ByVal fromDate As Date, ByVal toDate As Date) As Integer
Console.WriteLine(" You have requested the count of files created from" & fromDate & "to" & toDate)
Dim files() As String
files = System.IO.Directory.GetFiles("c:\windows")
Dim i, fileCount As Integer
For i = 0 To files.GetUpperBound(0)
Dim FI As New System.IO.FileInfo(files(i))
If FI.CreationTime.Date >= fromDate And FI.CreationTime.Date <= toDate Then
fileCount = fileCount + 1
End If
Next
Return (fileCount)
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class