0
Guys I have the following code in my DLL FTP to get the folders from the server:
Try
Dim Serv As Net.FtpWebRequest = GetRequest(GetDirectory(directory))
Serv.Method = Net.WebRequestMethods.Ftp.ListDirectory
Dim reader As New StreamReader(Serv.GetResponse().GetResponseStream())
Dim line = reader.ReadLine()
Dim lines As New List(Of String)
Do Until line Is Nothing
lines.Add(line)
line = reader.ReadLine()
Loop
Return lines.ToArray()
Catch ex As Exception
End Try
But whenever I try to list the directories in the list box of the form appears the following in LST System.String[]
For the sake of learning better, could you explain to me about LST’s Datasouce?
– Vyctor Junior
A question! If I do so n have how I know how many files will be listed above your code list three files! is limited to having to program the amount, isn’t it a dynamic thing or I’m wrong?? I’m new in VB :D
– Vyctor Junior
According to MSDN the property
DataSouce
is a property ofobject
implementing the interfaceIList
, then, you can receive as value Litas or Arrays. The example above is just to illustrate, see that you are doing the same thing in your codeDo Until
dynamically. To know the quantity just use the propertyCount
.– rubStackOverflow
Thank you! I get it right.
– Vyctor Junior
Don’t forget to rate the answer. @Vyctorjunior ;)
– rubStackOverflow