Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.6k views
in .NET FTP by (160 points)
Hello,

I'm using VB.Net 2003 and edtFTP and was wondering if someone could post a snippet of code on how to use FTPFile. Basically what I'm trying to accomplish is to get a directory listing and determine which item is a file and which item is a directory so that when I add them to the listview control I can Tag them as such.

Thanks

Great product!!

1 Answer

0 votes
by (160 points)
Never mind. I figured this out. :D

For anyone else who might run into this here is what I did:

'---
ListView1.Items.Clear()
Dim count As Integer
Dim fil() As FTPFile
fil = ftp.DirDetails(".")
For count = 0 To fil.Length - 1
If fil(count).Dir = True Then
itmvar = ListView1.Items.Add(fil(count).Name) : itmvar.Tag = "Dir"
Else
itmvar = ListView1.Items.Add(fil(count).Name) : itmvar.Tag = "File"
End If
Next
'---

Categories

...