tbf/TestBenchFramework/Forms/AboutDlg.cs
Milan Hanajik 1d098f7893 - Modifications for 'StableTime' (ValveMove, RegulValve, etc.
- SHA1 checksum calculated and displayed in AboutDlg (sample data 'nejaky text')
- Modifications for the Fuzhou300 component
2014-09-05 14:17:12 +02:00

34 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Security.Cryptography;
using System.Windows.Forms;
namespace TBF.Forms
{
/// <summary>
/// About dialog
/// </summary>
public partial class AboutDlg : Form
{
/// <summary>
/// Contsructor
/// </summary>
/// <param name="version">Language neutral version string</param>
/// <param name="buildDate">Regionally formated build date string</param>
public AboutDlg(string version, string buildDate)
{
InitializeComponent();
versionLabel.Text = versionLabel.Text.Replace("_VERSION_", version);
buildDateLabel.Text = buildDateLabel.Text.Replace("_BUILD_DATE_", buildDate);
byte[] sha1 = (new SHA1CryptoServiceProvider()).ComputeHash(Encoding.Default.GetBytes("nejaky text")); /// TODO: calculate SHA1 of real data
StringBuilder sb = new StringBuilder();
foreach (byte oneByte in sha1) { sb.Append(oneByte.ToString("X2")); }
secureHashLabel.Text = string.Format("SHA1: {0}", sb);
}
}
}