Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2k views
in .NET FTP by (120 points)
Hi,
Are there any example programs for the Popup Menu for FTPRemoteFileList ?

I have code for the MenuItemDownload_Click event as follows:

this.ftpRemoteFileList1.MenuItemDownload.Click += new EventHandler(MenuItemDownload_Click);

and

private void MenuItemDownload_Click(object sender, EventArgs e)
{
MessageBox.Show("Hi");
}

When I run the program and right click on the FTPRemoteFileList, the popup menu appears, when I click on "Download", I get an exception:

System.ArgumentNullException: Value cannot be null.
Parameter name: path1
at System.IO.Path.Combine(String path1, String path2)
at EnterpriseDT.Net.Ftp.Forms.FTPRemoteFileList.OnSelectItem(FTPFileListItem selectedItem, Boolean forceTransfer)
at EnterpriseDT.Net.Ftp.Forms.FTPFileList.TransferSelectedItems()
at EnterpriseDT.Net.Ftp.Forms.FTPFileList.MenuDownload_Click(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItem.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Command.DispatchID(Int32 id)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ListView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Thanks in advance.

1 Answer

0 votes
by (51.6k points)
I think this error is caused by SecureFTPConnection.LocalDirectory not being set before the directory contents is displayed. The next version of the software will set LocalDirectory to the process's current working directory if it is null when Connect is called. But until then you should be able to fix the problem by setting this property manually. So please insert the following line somewhere before Connect is called:
mySecureFTPConnection.LocalDirectory = Directory.GetCurrentDirectory();

You can of course set the directory to anything you like - just make sure it's not null.

Please let me know if it works.

- Hans (EnterpriseDT)

Categories

...