Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.6k views
in .NET FTP by (280 points)
I am using edtftpnetpro and in my aplication, I want the files that I selected from remote file list control. I referred edtftpnetpro help which tells me that there is a property "SelectedFileItems" in FTPRemoteList class which gets the list of files that are selected on the control. But when I try to do that, i do not get this method in the list on VS.Net.
Any help regarding the same is highly appreciated...Thanks in advance!!!

7 Answers

0 votes
by (51.6k points)
The SelectedFileItems property is available from code (and Intellisense), but it won't show up in the Properties View in VS.NET. In other words, code like this:
int numSelectedFiles = ftpConnection.SelectedFileItems.Length;
should work OK, even though you can't access the property from the Properties View.

The reason that it's not visible in the Properties View is that it doesn't have any meaning at design-time. In other words, there will never be any files selected while you're designing a form, so it doesn't make sense to show it.

Is that what you're finding? Or has something gone wrong with this property?

- Hans (EDT)
0 votes
by (280 points)
Ya that is what I need.
But how will I have the list of the filenames that are selected?
Will it be something like ftpConnection.SelectedFileItems.Filename which returns an array of filename or something?
Thanks!!!
0 votes
by (162k points)
It is a little convoluted. From the help:

public FTPFileListItem[] SelectedFileItems { get; }

If we look at the FTPFileListItem class, it contains a FileInfo reference from which the name of the file can be obtained.

So for example, if there are 10 FTPFileListItem objects returned, the filename of the 3rd file in the array would be:

ftpConnection.SelectedFileItems[2].FileInfo.Name
0 votes
by (280 points)
Thanks a lot!!! This made my life easy!
Also I wanted to know if I can get the remote directory path...I mean the value in the directory panel...
something like ftpRemoteFileList1.DirectoryPanel...
Thanks!!!
0 votes
by (280 points)
Can you please reply to my query? I need it.
I wanted to know if I can get the remote directory path...I mean the value in the directory panel...
something like ftpRemoteFileList1.DirectoryPanel...
0 votes
by (280 points)
If that is not possible, then can I get the parent directory of the selected file atleast?
0 votes
by (51.6k points)
Sorry, I did not see your question until now.

Since you are using a commercial version of our software, you are entitled to e-mail-based support, which has a better response-time. You can e-mail us as support@enterprisedt.

You can get the directory using FTPConnection.ServerDirectory. The FTPFile objects themselves do not contain the directory, though this is something we are intending to add in the future.

- Hans (EDT)

Categories

...