Exemplo n.º 1
0
        /// <summary>
        /// 実行
        /// </summary>
        /// <param name="ini">環境ファイル設定値</param>
        public void Run(IniReader ini)
        {
            String   type = ini.ProcessType;
            DateTime time = DateTime.Now;
            String   path = ini.BackupDirectory + String.Format("{0}{1:0000}{2:00}{3:00}", Util.Separator, time.Year, time.Month, time.Day);
            String   item = CheckItem(parameter);

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

            FileAttributes attr = File.GetAttributes(item);

            if (Object.Equals(attr & FileAttributes.Directory, FileAttributes.Directory))
            {
                DirectoryCopy(item, path, type);
            }
            else
            {
                FileCopy(item, path, type);
            }
        }