J
jobs
Say I only have a single file I want to get information on. How can I
adapt this code?
Dim dr As DataRow
Dim fi As FileInfo
Dim dir As New DirectoryInfo(filename)
Dim dt As New DataTable
dt.Columns.Add("FileName", GetType(String))
dt.Columns.Add("CeateTime", GetType(String))
dt.Columns.Add("Length", GetType(String))
For Each fi In dir.GetFiles()
dr = dt.NewRow
dr(0) = fi.Name
dr(1) = fi.CreationTime.Date.ToString
dr(2) = fi.Length
dt.Rows.Add(dr)
Next
Also, curious say i wanted to get the first or last file of the
GetFiles?
Thanks.
adapt this code?
Dim dr As DataRow
Dim fi As FileInfo
Dim dir As New DirectoryInfo(filename)
Dim dt As New DataTable
dt.Columns.Add("FileName", GetType(String))
dt.Columns.Add("CeateTime", GetType(String))
dt.Columns.Add("Length", GetType(String))
For Each fi In dir.GetFiles()
dr = dt.NewRow
dr(0) = fi.Name
dr(1) = fi.CreationTime.Date.ToString
dr(2) = fi.Length
dt.Rows.Add(dr)
Next
Also, curious say i wanted to get the first or last file of the
GetFiles?
Thanks.