Example #1
0
        /// <summary>
        /// 只执行单步备份操作,并返回正在执行的BackupCreater
        /// </summary>
        /// <param name="备份源文件名">备份源文件名</param>
        /// <param name="writeFileProcedure">写文件函数(要求唯一的参数为写文件名)</param>
        /// <param name="备份后缀名">备份后缀名</param>
        /// <param name="hideBackup">是否设置备份为隐藏文件</param>
        public static BackupCreater BackupOnce(string 备份源文件名, WriteProcedure writeFileProcedure = null, string 备份后缀名 = ".backup", bool hideBackup = false)
        {
            var ret = new BackupCreater(备份后缀名, writeFileProcedure, int.MaxValue, 备份后缀名, hideBackup);

            ret.StartOnce();
            return(ret);
        }
Example #2
0
        /// <summary>
        /// 开启自动备份,并返回正在执行的BackupCreater
        /// </summary>
        /// <param name="备份源文件名">备份源文件名</param>
        /// <param name="writeFileProcedure">写文件函数(要求唯一的参数为写文件名)</param>
        /// <param name="interval">备份间隔(毫秒)</param>
        /// <param name="备份后缀名">备份后缀名</param>
        /// <param name="hideBackup">是否设置备份为隐藏文件</param>
        public static BackupCreater Backup(string 备份源文件名, WriteProcedure writeFileProcedure = null, int interval = 1000, string 备份后缀名 = ".backup", bool hideBackup = false)
        {
            var ret = new BackupCreater(备份后缀名, writeFileProcedure, interval, 备份后缀名, hideBackup);

            ret.Start();
            return(ret);
        }