AddonHelper.Addon.Backup C# (CSharp) Метод

Backup() публичный Метод

Make a backup of the given file buffer as the current filename
public Backup ( byte buffer, string filename ) : void
buffer byte The file buffer
filename string The filename
Результат void
        public void Backup(byte[] buffer, string filename)
        {
            if (appSettings.GetBool("BackupsEnabled")) {
                string path = appSettings.GetString("BackupsPath");

                if (!Directory.Exists(path))
                    Directory.CreateDirectory(path);

                string fnm = formatFilename(filename);
                File.WriteAllBytes(path + "/" + fnm, buffer);
            }
        }

Same methods

Addon::Backup ( string sourceFile ) : void