tbf/TestBenchFramework/Forms/AboutDlg.cs
2015-04-15 20:32:56 +02:00

41 lines
1.3 KiB
C#

///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
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>
public AboutDlg()
{
InitializeComponent();
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
///
Version ver = asm.GetName().Version;
versionLabel.Text = versionLabel.Text.Replace("_VERSION_", string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build));
///
DateTime buildTime = new System.IO.FileInfo(asm.Location).LastWriteTime;
buildDateLabel.Text = buildDateLabel.Text.Replace("_BUILD_DATE_", buildTime.ToShortDateString());
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);
}
}
}