public bool ShowDirectory(string path, bool refresh, bool showHidden) { FilePath fp = new FilePath(path, PathFormat.Unix); DirectoryListing dl = new DirectoryListing(); try { dl = m_networking.GetDirectoryListing(fp, showHidden); } catch (Exception e) { // for simplicity, assume it's an SftpException and we don't have // permission to this directory MessageBox.Show("You don't have permission to read this directory", "Permissions Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } listView1.Items.Clear(); txtCurrentPath.Text = path; m_currentPath.AssignDir(path, PathFormat.Unix); m_currentDirListing = dl; FillListView(); return(true); }
public FilePath GetUserHomeDirectory() { EnsureSFTPConnection(); FilePath home = new FilePath(); home.AssignDir(Sftp.Home, PathFormat.Unix); return(home); }