82 lines
2.1 KiB
C#
82 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using HZQR.Common;
|
|
|
|
namespace ZipTool.Config
|
|
{
|
|
/// <summary>
|
|
/// 系统配置参数
|
|
/// </summary>
|
|
public class AppSettings
|
|
{
|
|
#region 要压缩的文件夹路径
|
|
internal const string _ZipDirectory = @"D:\!!!重要数据备份";
|
|
/// <summary>
|
|
/// 要压缩的文件夹路径
|
|
/// </summary>
|
|
public static string ZipDirectory
|
|
{
|
|
get
|
|
{
|
|
if (ConfigurationManager.AppSettings["ZipDirectory"] == null)
|
|
{
|
|
return _ZipDirectory;
|
|
}
|
|
else
|
|
{
|
|
return ConfigurationManager.AppSettings["ZipDirectory"];
|
|
}
|
|
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 压缩文件存放的路径
|
|
internal const string _ZipFileDirectory = @"D:\!!!ZipFile";
|
|
/// <summary>
|
|
/// 压缩文件存放的路径
|
|
/// </summary>
|
|
public static string ZipFileDirectory
|
|
{
|
|
get
|
|
{
|
|
if (ConfigurationManager.AppSettings["ZipFileDirectory"] == null)
|
|
{
|
|
return _ZipFileDirectory;
|
|
}
|
|
else
|
|
{
|
|
return ConfigurationManager.AppSettings["ZipFileDirectory"];
|
|
}
|
|
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 清理历史压缩文件的天数
|
|
internal const int _DeleteDays = -3;
|
|
/// <summary>
|
|
/// 清理历史压缩文件的天数
|
|
/// </summary>
|
|
public static int DeleteDays
|
|
{
|
|
get
|
|
{
|
|
if (ConfigurationManager.AppSettings["DeleteDays"] == null)
|
|
{
|
|
return _DeleteDays;
|
|
}
|
|
else
|
|
{
|
|
return ConfigurationManager.AppSettings["DeleteDays"].TryParseToInt();
|
|
}
|
|
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|