init: 导入项目到 meswork Gitea
This commit is contained in:
50
DataMirrorTools_Simulator/02DataLinkMesWork/Reg.cs
Normal file
50
DataMirrorTools_Simulator/02DataLinkMesWork/Reg.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user