51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using System.Xml;
|
|
|
|
namespace DataLinkMesWork
|
|
{
|
|
public partial class Reg : Form
|
|
{
|
|
public Reg()
|
|
{
|
|
InitializeComponent();
|
|
string sn;
|
|
KeyWordTest.KeyWordNew(out sn);
|
|
textBox_SerialNumberStr.Text = sn;
|
|
}
|
|
/// <summary>
|
|
/// 注册,改写注册表
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void Button_Reg_Click(object sender, EventArgs e)
|
|
{
|
|
string AppValue;
|
|
AppValue = textBox_CopyRightCode.Text;
|
|
ChangeConfig( AppValue);
|
|
string SerialNumberStr;
|
|
if (KeyWordTest.KeyWordNew(out SerialNumberStr))
|
|
{
|
|
MessageBox.Show("注册成功");
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("注册失败");
|
|
}
|
|
this.Close();
|
|
}
|
|
public void ChangeConfig(string sn)
|
|
{
|
|
System.IO.File.WriteAllText(KeyWordTest.pathConfigFileSN, sn);
|
|
}
|
|
}
|
|
}
|