Hi. I am working on this ftp client and i want a column of the listview to show the date modified. I've got the code but here's the problem:
Private Sub RefreshList()
FTPDownload.Hostname = LoginMenu.TextBox3.Text.Trim
FTPDownload.Username = LoginMenu.TextBox1.Text
FTPDownload.Password = LoginMenu.TextBox2.Text
ListView1.Items.Clear()
Try
For Each File In FTPDownload.ListDirectory
Dim ext As String = IO.Path.GetExtension(File)
Dim ftp1 As Net.FtpWebRequest = Net.FtpWebRequest.Create(LoginMenu.TextBox3.Text & ToolStripStatusLabel2.Text & ToolStripStatusLabel5.Text)
ftp1.Credentials = New NetworkCredential(LoginMenu.TextBox1.Text, LoginMenu.TextBox2.Text)
ftp1.Method = Net.WebRequestMethods.Ftp.GetDateTimestamp
Dim dte As DateTime
Using response1 = CType(ftp1.GetResponse(), Net.FtpWebResponse)
dte = response1.LastModified
ListView1.Items.Add(New ListViewItem({File, ext, dte}))
ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize)
End Using
Next
Catch ex As Exception
End Try
End Sub
I made another sub and that goes into listview click. Each time i click an item in the listview it shows the date but when the form loads the RefreshList() sub nothing happens. It doesn't show the modified dates...
Can someone help me please :)