* Добавлены методы для показа информационных сообщений * Обновлена логика основной формы Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using System.IO;
|
|
using System.Security.Cryptography;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace SaveWizard_rewritten
|
|
{
|
|
static class Utils
|
|
{
|
|
public static string GenerateMD5(string filename)
|
|
{
|
|
if (!File.Exists(filename))
|
|
return null;
|
|
using (var md5 = MD5.Create())
|
|
{
|
|
using (FileStream stream = File.OpenRead(filename))
|
|
md5.ComputeHash(stream);
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
byte[] hash = md5.Hash;
|
|
for (int i = 0; i < hash.Length; i++)
|
|
sb.Append(hash[i].ToString("x2"));
|
|
|
|
return sb.ToString();
|
|
}
|
|
}
|
|
|
|
public static void ShowError(string message)
|
|
{
|
|
MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
|
|
public static void ShowInfo(string message)
|
|
{
|
|
MessageBox.Show(message, "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
}
|
|
}
|
|
}
|