Exemple #1
0
        protected override void InvokeOnChangeDirectory(FtpChangeDirectoryArgs e)
        {
            String lPath = e.NewDirectory;

            if (lPath.IndexOf('/') != 0)
            {
                throw new Exception(String.Format("Not an absolute path: \"{0}\"", lPath));
            }

            VirtualFtpSession lSession = (VirtualFtpSession)e.Session;
            IFtpFolder        lFolder  = RootFolder.DigForSubFolder(lPath.Substring(1), lSession);

            if (lFolder != null)
            {
                ((VirtualFtpSession)e.Session).CurrentFolder = lFolder;
            }

            e.ChangeDirOk = (lFolder != null);
            base.InvokeOnChangeDirectory(e);
        }