fs.Close();
fs.Dispose();
FileAttributes fileAttr = File.GetAttributes(path);
File.SetAttributes(path, FileAttributes.Archive);
File.Delete(path);
File.Move(path + ".temp", path);
File.SetAttributes(path, fileAttr);
}
}
}
catch (Exception ex)
{
File.Delete(path + ".temp");
throw ex;
}
}
#endregion
#region 解密文件
/// <summary>
/// 解密文件
/// </summary>
public static void DecryptFile(string path, string pwd, RefreshFileProgress refreshFileProgress)
{
try
{
if (File.Exists(path + ".temp")) File.Delete(path + ".temp");
using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))










