0

Hello all. I am a new returnee to .net after several years in Coldfusion I have forgot a vast majority of what I knew ir thought I new. I have been tasked to build a page or code that looks through a folder for any files created yesterday, then send an e-mail to the area who owns the file.

I have gotten the code to read the files in a folder looking for an ID in the file name. But I am at a loss as to how to just pull files that were created on a specific date. There are 7 years worth of files in the folder so I do not want to got through them all if I can avoid it.

Here is what I have to read the file name....any help is greatly appreciated.

Private Sub loadFiles()
       
        Dim fileCount As Integer = System.IO.Directory.GetFiles("C:\Invoice\", "654444*").Length
        Dim arrFiles() As String = System.IO.Directory.GetFiles("c:\Invoice\", "654444*")
        Dim i As Integer

        For i = 0 To fileCount - 1
            Dim currentFile As String = arrFiles(i)

            ListBox1.Items.Add(currentFile)
        Next

    End Sub


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ListBox1.Items.Clear()
    End Sub
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Lusiphur
1

Have you perhaps tried running a check against File.GetCreationTime for the files in the list to determine the created date for the file(s) against the date range you're targeting?

Hope this helps :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.