For Each line In Values
' Create rows collection using TableRow object to dynamically add rows
Dim tRow As New TableRow()
' Split the current line in the Values list
Dim split As String() = line.Split(New [Char]() {})
' Assign the values from the split(0...5)
Dim sb_Text As String = ""
Dim sb_CTime As String = ""
' Set Time Zone
Dim sb_TZ As String = "EST"
' Reset the counter to 0 for each line
Dim evaluated As Int32 = 0
Dim sl As New LiteralControl
' Loop through the split string array to get the values assigned to the elements
' passed to the TableCell object, should always be 6 elements/columns
For Each s As String In split
' Create a new cell fro the current row
Dim tCell As New TableCell()
Dim dRow As DataRow
dRow = dt.NewRow()
' If the current s value contains pdf or txt, s is the Text value
If s.Contains("pdf") Or s.Contains("txt") Then
sb_Text = "<a href=""" + RepURLPath + s + """>" + s + "</a>"
evaluated = evaluated + 1
' Create a Hyperlink Web Server control and add to cell
Dim h As New HyperLink()
h.Text = s
h.NavigateUrl = sb_Text
' Add cell to row
h = h
'tCell.Controls.Add(h)
'tCell.Text = h.Text
dRow("File") = h
' If s contains :, it must be the CTime value
ElseIf s.Contains(":") Then
sb_CTime = s
evaluated = evaluated + 1
' Used instr to find first colon, advance to milliseconds, then remove milliseconds
' from the second colon on
Dim colfind = InStr(":", sb_CTime)
sb_CTime = sb_CTime.Remove(colfind + 4, 3)
' Convert string to string literal control
'sl.Text = sb_CTime
'tCell.Controls.Add(sl)
'tCell.Text = sl.Text
dRow("Time") = sb_CTime
' If s contains AM or PM, it must be Ampm value
ElseIf s.Contains("AM") Or s.Contains("PM") Then
evaluated = evaluated + 1
' Convert string to string literal control
'sl.Text = s
'tCell.Controls.Add(sl)
'tCell.Text = sl.Text
dRow("AM/PM") = s
' If s contains / , it must be the modified/lastwrite value
ElseIf s.Contains("/") Then
evaluated = evaluated + 1
' Convert string to string literal control
'sl.Text = s
'tCell.Controls.Add(sl)
'tCell.Text = sl.Text
dRow("Date") = s
' Else s does not contain does not contain the punctuation marks
' : < and / , it must be the fsize value+
Else
evaluated = evaluated + 1
' Convert string to string literal control
'sl.Text = s
'tCell.Controls.Add(sl)
'tCell.Text = sl.Text
dRow("Size") = s
End If
' If evaluated is equal to 5, (0...4), all seperate elements of the single
' value s have been evaluated. Output the lines into the formated columns
' changed to 5 from 6 because the <BR> was removed
If evaluated = 5 Then
' Add time zone cell to row
dRow("Zone") = sb_TZ
' Add new table cells object to the row
tRow.Cells.Add(tCell)
End If
Next
' Add cell collection/row to table once all values for the current line is evaluated
dt.Rows.Add(tRow)
Next