using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
namespace SysReg
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
/// <summary>
/// MD5加密
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string md5(string str)
{
MD5 m = new MD5CryptoServiceProvider();
byte[] s = m.ComputeHash(UnicodeEncoding.UTF8.GetBytes(str));
return BitConverter.ToString(s);
}
private void button1_Click(object sender, EventArgs e)
{
textBox2.Text = md5(textBox1.Text);
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
}
}
这是一段软件注册的代码