private void btnClick_Click(object sender, EventArgs e) { txtGetDirTree.Text = ""; ftp1.Server = txtHost.Text; ftp1.Port = Convert.ToInt32(txtPort.Text); ftp1.UserName = txtUser.Text; ftp1.Password = txtPassword.Text; ftp1.Open(); try { m_level = ""; GetRecursiveList(txtRootDir.Text, ""); } finally { ftp1.Close(); MessageBox.Show("Done"); } }
private void GetRecursiveList(string dirName, string level) { string old = m_level; try { m_level += level; ftp1.ChangeCurrentDir(dirName); ftp1.GetDirectoryListing(); ftp1.ChangeToParentDir(); } finally { m_level = old; } }
private void ftp1_DirectoryListing(object sender, DirectoryListingEventArgs e) { txtGetDirTree.AppendText(m_level + e.FileInfo.FileName + "\r\n"); if (e.FileInfo.IsDirectory) { GetRecursiveList(e.FileInfo.FileName, "\t"); } }
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add admin@clevercomponents.com to your trusted senders list in your email software.