Esempio n. 1
0
        public FtpCreationResult CreateBackupFtpFolder()
        {
            var    remotePathName = Guid.NewGuid().ToString();
            string backupFolder   = ConfigurationManager.AppSettings["ftpBackupFolder"];

            string[]          folders = FTPHelper.GetFileList(backupFolder);
            FtpCreationResult result  = new FtpCreationResult();

            if (folders != null)
            {
                if (folders.Length != null)
                {
                    if (folders.Contains(remotePathName))
                    {
                        result.FtpRemoteFolder = remotePathName;
                    }
                    else
                    {
                        remotePathName         = FTPHelper.CreateBackupFolder(remotePathName);
                        result.FtpRemoteFolder = remotePathName;
                    }
                }
            }
            else
            {
                remotePathName         = FTPHelper.CreateBackupFolder(remotePathName);
                result.FtpRemoteFolder = remotePathName;
            }
            return(result);
        }