示例#1
0
        protected void BindGrid()
        {
            BackupFileCollection collection = MaintenanceManager.GetAllBackupFiles();

            gvBackups.DataSource = collection;
            gvBackups.DataBind();
        }
示例#2
0
        /// <summary>
        /// Gets all backup files
        /// </summary>
        /// <returns>Backup file collection</returns>
        public static BackupFileCollection GetAllBackupFiles()
        {
            var collection = new BackupFileCollection();

            string path = string.Format("{0}Administration\\backups\\", HttpContext.Current.Request.PhysicalApplicationPath);

            foreach (var fullFileName in System.IO.Directory.GetFiles(path))
            {
                var fileName = Path.GetFileName(fullFileName);
                if (fileName == "Index.htm")
                {
                    continue;
                }

                var info = new FileInfo(fullFileName);
                collection.Add(new BackupFile()
                {
                    FullFileName = fullFileName,
                    FileName     = fileName,
                    FileSize     = info.Length
                });
            }

            return(collection);
        }
        /// <summary>
        /// Gets all backup files
        /// </summary>
        /// <returns>Backup file collection</returns>
        public static BackupFileCollection GetAllBackupFiles()
        {
            var collection = new BackupFileCollection();

            string path = string.Format("{0}Administration\\backups\\", HttpContext.Current.Request.PhysicalApplicationPath);
            foreach (var fullFileName in System.IO.Directory.GetFiles(path))
            {
                var fileName = Path.GetFileName(fullFileName);
                if (fileName == "Index.htm")
                    continue;

                var info = new FileInfo(fullFileName);
                collection.Add(new BackupFile()
                {
                    FullFileName = fullFileName,
                    FileName = fileName,
                    FileSize = info.Length
                });
            }

            return collection;
        }