546 lines
22 KiB
C#
546 lines
22 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: HPG_68D.PasswordForm
|
|
// Assembly: HPG-68D, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
|
// MVID: 530C99A8-8EEF-42C8-8A74-66FDE7B322C3
|
|
// Assembly location: C:\Program Files (x86)\HONGKAIDE\HPG-68D\HPG-68D.exe
|
|
|
|
using HPG_68D.My;
|
|
using Microsoft.VisualBasic;
|
|
using Microsoft.VisualBasic.CompilerServices;
|
|
using System;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
|
|
namespace HPG_68D
|
|
{
|
|
[DesignerGenerated]
|
|
public class PasswordForm : Form
|
|
{
|
|
private static ArrayList __ENCList = new ArrayList();
|
|
private IContainer components;
|
|
[AccessedThroughProperty("Label1")]
|
|
private Label _Label1;
|
|
[AccessedThroughProperty("TextBoxPassword")]
|
|
private TextBox _TextBoxPassword;
|
|
[AccessedThroughProperty("ButtonOK")]
|
|
private Button _ButtonOK;
|
|
[AccessedThroughProperty("ButtonCannel")]
|
|
private Button _ButtonCannel;
|
|
[AccessedThroughProperty("Label2")]
|
|
private Label _Label2;
|
|
[AccessedThroughProperty("TextBox_NewPassword_R")]
|
|
private TextBox _TextBox_NewPassword_R;
|
|
[AccessedThroughProperty("CheckBox_WritePassword")]
|
|
private CheckBox _CheckBox_WritePassword;
|
|
[AccessedThroughProperty("CheckBox_ReadPassword")]
|
|
private CheckBox _CheckBox_ReadPassword;
|
|
[AccessedThroughProperty("GroupBox_ReadPassword")]
|
|
private GroupBox _GroupBox_ReadPassword;
|
|
[AccessedThroughProperty("Label3")]
|
|
private Label _Label3;
|
|
[AccessedThroughProperty("TextBox_EnterPassword_R")]
|
|
private TextBox _TextBox_EnterPassword_R;
|
|
[AccessedThroughProperty("GroupBox_WritePassword")]
|
|
private GroupBox _GroupBox_WritePassword;
|
|
[AccessedThroughProperty("TextBox_OldPassword_W")]
|
|
private TextBox _TextBox_OldPassword_W;
|
|
[AccessedThroughProperty("Label4")]
|
|
private Label _Label4;
|
|
[AccessedThroughProperty("Label5")]
|
|
private Label _Label5;
|
|
[AccessedThroughProperty("Label6")]
|
|
private Label _Label6;
|
|
[AccessedThroughProperty("TextBox_EnterPassword_W")]
|
|
private TextBox _TextBox_EnterPassword_W;
|
|
[AccessedThroughProperty("TextBox_NewPassword_W")]
|
|
private TextBox _TextBox_NewPassword_W;
|
|
|
|
[DebuggerNonUserCode]
|
|
static PasswordForm()
|
|
{
|
|
}
|
|
|
|
[DebuggerNonUserCode]
|
|
public PasswordForm()
|
|
{
|
|
Load += PasswordForm_Load;
|
|
__ENCList.Add((object) new WeakReference((object) this));
|
|
InitializeComponent();
|
|
}
|
|
|
|
[DebuggerNonUserCode]
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing && components != null)
|
|
components.Dispose();
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
[DebuggerStepThrough]
|
|
private void InitializeComponent()
|
|
{
|
|
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (PasswordForm));
|
|
Label1 = new Label();
|
|
TextBoxPassword = new TextBox();
|
|
ButtonOK = new Button();
|
|
ButtonCannel = new Button();
|
|
Label2 = new Label();
|
|
TextBox_NewPassword_R = new TextBox();
|
|
CheckBox_WritePassword = new CheckBox();
|
|
CheckBox_ReadPassword = new CheckBox();
|
|
GroupBox_ReadPassword = new GroupBox();
|
|
Label3 = new Label();
|
|
TextBox_EnterPassword_R = new TextBox();
|
|
GroupBox_WritePassword = new GroupBox();
|
|
TextBox_OldPassword_W = new TextBox();
|
|
Label4 = new Label();
|
|
Label5 = new Label();
|
|
Label6 = new Label();
|
|
TextBox_EnterPassword_W = new TextBox();
|
|
TextBox_NewPassword_W = new TextBox();
|
|
GroupBox_ReadPassword.SuspendLayout();
|
|
GroupBox_WritePassword.SuspendLayout();
|
|
SuspendLayout();
|
|
Label1.AccessibleDescription = (string) null;
|
|
Label1.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) Label1, "Label1");
|
|
Label1.Font = (Font) null;
|
|
Label1.Name = "Label1";
|
|
TextBoxPassword.AccessibleDescription = (string) null;
|
|
TextBoxPassword.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) TextBoxPassword, "TextBoxPassword");
|
|
TextBoxPassword.BackgroundImage = (Image) null;
|
|
TextBoxPassword.Font = (Font) null;
|
|
TextBoxPassword.Name = "TextBoxPassword";
|
|
ButtonOK.AccessibleDescription = (string) null;
|
|
ButtonOK.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) ButtonOK, "ButtonOK");
|
|
ButtonOK.BackgroundImage = (Image) null;
|
|
ButtonOK.Font = (Font) null;
|
|
ButtonOK.Name = "ButtonOK";
|
|
ButtonOK.UseVisualStyleBackColor = true;
|
|
ButtonCannel.AccessibleDescription = (string) null;
|
|
ButtonCannel.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) ButtonCannel, "ButtonCannel");
|
|
ButtonCannel.BackgroundImage = (Image) null;
|
|
ButtonCannel.Font = (Font) null;
|
|
ButtonCannel.Name = "ButtonCannel";
|
|
ButtonCannel.UseVisualStyleBackColor = true;
|
|
Label2.AccessibleDescription = (string) null;
|
|
Label2.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) Label2, "Label2");
|
|
Label2.Font = (Font) null;
|
|
Label2.Name = "Label2";
|
|
TextBox_NewPassword_R.AccessibleDescription = (string) null;
|
|
TextBox_NewPassword_R.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) TextBox_NewPassword_R, "TextBox_NewPassword_R");
|
|
TextBox_NewPassword_R.BackgroundImage = (Image) null;
|
|
TextBox_NewPassword_R.Font = (Font) null;
|
|
TextBox_NewPassword_R.Name = "TextBox_NewPassword_R";
|
|
CheckBox_WritePassword.AccessibleDescription = (string) null;
|
|
CheckBox_WritePassword.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) CheckBox_WritePassword, "CheckBox_WritePassword");
|
|
CheckBox_WritePassword.BackgroundImage = (Image) null;
|
|
CheckBox_WritePassword.Font = (Font) null;
|
|
CheckBox_WritePassword.Name = "CheckBox_WritePassword";
|
|
CheckBox_WritePassword.UseVisualStyleBackColor = true;
|
|
CheckBox_ReadPassword.AccessibleDescription = (string) null;
|
|
CheckBox_ReadPassword.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) CheckBox_ReadPassword, "CheckBox_ReadPassword");
|
|
CheckBox_ReadPassword.BackgroundImage = (Image) null;
|
|
CheckBox_ReadPassword.Font = (Font) null;
|
|
CheckBox_ReadPassword.Name = "CheckBox_ReadPassword";
|
|
CheckBox_ReadPassword.UseVisualStyleBackColor = true;
|
|
GroupBox_ReadPassword.AccessibleDescription = (string) null;
|
|
GroupBox_ReadPassword.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) GroupBox_ReadPassword, "GroupBox_ReadPassword");
|
|
GroupBox_ReadPassword.BackgroundImage = (Image) null;
|
|
GroupBox_ReadPassword.Controls.Add((Control) TextBoxPassword);
|
|
GroupBox_ReadPassword.Controls.Add((Control) Label1);
|
|
GroupBox_ReadPassword.Controls.Add((Control) Label3);
|
|
GroupBox_ReadPassword.Controls.Add((Control) Label2);
|
|
GroupBox_ReadPassword.Controls.Add((Control) TextBox_EnterPassword_R);
|
|
GroupBox_ReadPassword.Controls.Add((Control) TextBox_NewPassword_R);
|
|
GroupBox_ReadPassword.Font = (Font) null;
|
|
GroupBox_ReadPassword.Name = "GroupBox_ReadPassword";
|
|
GroupBox_ReadPassword.TabStop = false;
|
|
Label3.AccessibleDescription = (string) null;
|
|
Label3.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) Label3, "Label3");
|
|
Label3.Font = (Font) null;
|
|
Label3.Name = "Label3";
|
|
TextBox_EnterPassword_R.AccessibleDescription = (string) null;
|
|
TextBox_EnterPassword_R.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) TextBox_EnterPassword_R, "TextBox_EnterPassword_R");
|
|
TextBox_EnterPassword_R.BackgroundImage = (Image) null;
|
|
TextBox_EnterPassword_R.Font = (Font) null;
|
|
TextBox_EnterPassword_R.Name = "TextBox_EnterPassword_R";
|
|
GroupBox_WritePassword.AccessibleDescription = (string) null;
|
|
GroupBox_WritePassword.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) GroupBox_WritePassword, "GroupBox_WritePassword");
|
|
GroupBox_WritePassword.BackgroundImage = (Image) null;
|
|
GroupBox_WritePassword.Controls.Add((Control) TextBox_OldPassword_W);
|
|
GroupBox_WritePassword.Controls.Add((Control) Label4);
|
|
GroupBox_WritePassword.Controls.Add((Control) Label5);
|
|
GroupBox_WritePassword.Controls.Add((Control) Label6);
|
|
GroupBox_WritePassword.Controls.Add((Control) TextBox_EnterPassword_W);
|
|
GroupBox_WritePassword.Controls.Add((Control) TextBox_NewPassword_W);
|
|
GroupBox_WritePassword.Font = (Font) null;
|
|
GroupBox_WritePassword.Name = "GroupBox_WritePassword";
|
|
GroupBox_WritePassword.TabStop = false;
|
|
TextBox_OldPassword_W.AccessibleDescription = (string) null;
|
|
TextBox_OldPassword_W.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) TextBox_OldPassword_W, "TextBox_OldPassword_W");
|
|
TextBox_OldPassword_W.BackgroundImage = (Image) null;
|
|
TextBox_OldPassword_W.Font = (Font) null;
|
|
TextBox_OldPassword_W.Name = "TextBox_OldPassword_W";
|
|
Label4.AccessibleDescription = (string) null;
|
|
Label4.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) Label4, "Label4");
|
|
Label4.Font = (Font) null;
|
|
Label4.Name = "Label4";
|
|
Label5.AccessibleDescription = (string) null;
|
|
Label5.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) Label5, "Label5");
|
|
Label5.Font = (Font) null;
|
|
Label5.Name = "Label5";
|
|
Label6.AccessibleDescription = (string) null;
|
|
Label6.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) Label6, "Label6");
|
|
Label6.Font = (Font) null;
|
|
Label6.Name = "Label6";
|
|
TextBox_EnterPassword_W.AccessibleDescription = (string) null;
|
|
TextBox_EnterPassword_W.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) TextBox_EnterPassword_W, "TextBox_EnterPassword_W");
|
|
TextBox_EnterPassword_W.BackgroundImage = (Image) null;
|
|
TextBox_EnterPassword_W.Font = (Font) null;
|
|
TextBox_EnterPassword_W.Name = "TextBox_EnterPassword_W";
|
|
TextBox_NewPassword_W.AccessibleDescription = (string) null;
|
|
TextBox_NewPassword_W.AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) TextBox_NewPassword_W, "TextBox_NewPassword_W");
|
|
TextBox_NewPassword_W.BackgroundImage = (Image) null;
|
|
TextBox_NewPassword_W.Font = (Font) null;
|
|
TextBox_NewPassword_W.Name = "TextBox_NewPassword_W";
|
|
AccessibleDescription = (string) null;
|
|
AccessibleName = (string) null;
|
|
componentResourceManager.ApplyResources((object) this, "$this");
|
|
AutoScaleMode = AutoScaleMode.Font;
|
|
BackgroundImage = (Image) null;
|
|
Controls.Add((Control) GroupBox_WritePassword);
|
|
Controls.Add((Control) GroupBox_ReadPassword);
|
|
Controls.Add((Control) CheckBox_ReadPassword);
|
|
Controls.Add((Control) CheckBox_WritePassword);
|
|
Controls.Add((Control) ButtonCannel);
|
|
Controls.Add((Control) ButtonOK);
|
|
Font = (Font) null;
|
|
FormBorderStyle = FormBorderStyle.FixedDialog;
|
|
MaximizeBox = false;
|
|
MinimizeBox = false;
|
|
Name = nameof (PasswordForm);
|
|
GroupBox_ReadPassword.ResumeLayout(false);
|
|
GroupBox_ReadPassword.PerformLayout();
|
|
GroupBox_WritePassword.ResumeLayout(false);
|
|
GroupBox_WritePassword.PerformLayout();
|
|
ResumeLayout(false);
|
|
PerformLayout();
|
|
}
|
|
|
|
internal virtual Label Label1
|
|
{
|
|
[DebuggerNonUserCode] get => _Label1;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => _Label1 = value;
|
|
}
|
|
|
|
internal virtual TextBox TextBoxPassword
|
|
{
|
|
[DebuggerNonUserCode] get => _TextBoxPassword;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
_TextBoxPassword = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Button ButtonOK
|
|
{
|
|
[DebuggerNonUserCode] get => _ButtonOK;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
if (_ButtonOK != null)
|
|
_ButtonOK.Click -= ButtonOK_Click;
|
|
_ButtonOK = value;
|
|
if (_ButtonOK == null)
|
|
return;
|
|
_ButtonOK.Click += ButtonOK_Click;
|
|
}
|
|
}
|
|
|
|
internal virtual Button ButtonCannel
|
|
{
|
|
[DebuggerNonUserCode] get => _ButtonCannel;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
if (_ButtonCannel != null)
|
|
_ButtonCannel.Click -= ButtonCannel_Click;
|
|
_ButtonCannel = value;
|
|
if (_ButtonCannel == null)
|
|
return;
|
|
_ButtonCannel.Click += ButtonCannel_Click;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label2
|
|
{
|
|
[DebuggerNonUserCode] get => _Label2;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => _Label2 = value;
|
|
}
|
|
|
|
internal virtual TextBox TextBox_NewPassword_R
|
|
{
|
|
[DebuggerNonUserCode] get => _TextBox_NewPassword_R;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
_TextBox_NewPassword_R = value;
|
|
}
|
|
}
|
|
|
|
internal virtual CheckBox CheckBox_WritePassword
|
|
{
|
|
[DebuggerNonUserCode] get => _CheckBox_WritePassword;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
if (_CheckBox_WritePassword != null)
|
|
_CheckBox_WritePassword.CheckedChanged -= CheckBox_WritePassword_CheckedChanged;
|
|
_CheckBox_WritePassword = value;
|
|
if (_CheckBox_WritePassword == null)
|
|
return;
|
|
_CheckBox_WritePassword.CheckedChanged += CheckBox_WritePassword_CheckedChanged;
|
|
}
|
|
}
|
|
|
|
internal virtual CheckBox CheckBox_ReadPassword
|
|
{
|
|
[DebuggerNonUserCode] get => _CheckBox_ReadPassword;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
if (_CheckBox_ReadPassword != null)
|
|
_CheckBox_ReadPassword.CheckedChanged -= CheckBox_ReadPassword_CheckedChanged;
|
|
_CheckBox_ReadPassword = value;
|
|
if (_CheckBox_ReadPassword == null)
|
|
return;
|
|
_CheckBox_ReadPassword.CheckedChanged += CheckBox_ReadPassword_CheckedChanged;
|
|
}
|
|
}
|
|
|
|
internal virtual GroupBox GroupBox_ReadPassword
|
|
{
|
|
[DebuggerNonUserCode] get => _GroupBox_ReadPassword;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
_GroupBox_ReadPassword = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label3
|
|
{
|
|
[DebuggerNonUserCode] get => _Label3;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => _Label3 = value;
|
|
}
|
|
|
|
internal virtual TextBox TextBox_EnterPassword_R
|
|
{
|
|
[DebuggerNonUserCode] get => _TextBox_EnterPassword_R;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
_TextBox_EnterPassword_R = value;
|
|
}
|
|
}
|
|
|
|
internal virtual GroupBox GroupBox_WritePassword
|
|
{
|
|
[DebuggerNonUserCode] get => _GroupBox_WritePassword;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
_GroupBox_WritePassword = value;
|
|
}
|
|
}
|
|
|
|
internal virtual TextBox TextBox_OldPassword_W
|
|
{
|
|
[DebuggerNonUserCode] get => _TextBox_OldPassword_W;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
_TextBox_OldPassword_W = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label4
|
|
{
|
|
[DebuggerNonUserCode] get => _Label4;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => _Label4 = value;
|
|
}
|
|
|
|
internal virtual Label Label5
|
|
{
|
|
[DebuggerNonUserCode] get => _Label5;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => _Label5 = value;
|
|
}
|
|
|
|
internal virtual Label Label6
|
|
{
|
|
[DebuggerNonUserCode] get => _Label6;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => _Label6 = value;
|
|
}
|
|
|
|
internal virtual TextBox TextBox_EnterPassword_W
|
|
{
|
|
[DebuggerNonUserCode] get => _TextBox_EnterPassword_W;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
_TextBox_EnterPassword_W = value;
|
|
}
|
|
}
|
|
|
|
internal virtual TextBox TextBox_NewPassword_W
|
|
{
|
|
[DebuggerNonUserCode] get => _TextBox_NewPassword_W;
|
|
[DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
_TextBox_NewPassword_W = value;
|
|
}
|
|
}
|
|
|
|
private void PasswordForm_Load(object sender, EventArgs e)
|
|
{
|
|
int num = 0;
|
|
MyProject.Forms.MDIParent1.SetControl_U8_Data((Control) CheckBox_ReadPassword, checked (num + 11), publicva.Bit5, 0);
|
|
MyProject.Forms.MDIParent1.SetControl_U8_Data((Control) CheckBox_WritePassword, checked (num + 11), publicva.Bit6, 0);
|
|
CheckBox_ReadPassword_CheckedChanged(RuntimeHelpers.GetObjectValue(sender), e);
|
|
CheckBox_WritePassword_CheckedChanged(RuntimeHelpers.GetObjectValue(sender), e);
|
|
}
|
|
|
|
private void ButtonCannel_Click(object sender, EventArgs e) => Close();
|
|
|
|
private void ButtonOK_Click(object sender, EventArgs e)
|
|
{
|
|
int num1 = 60;
|
|
string Right1 = Strings.RTrim(Encoding.ASCII.GetString(publicva.EEPROM_Byte, checked (num1 + 0), 16));
|
|
int num2 = 70;
|
|
string Right2 = Strings.RTrim(Encoding.ASCII.GetString(publicva.EEPROM_Byte, checked (num2 + 0), 16));
|
|
int num3 = 0;
|
|
if (((uint) publicva.EEPROM_Byte[checked (num3 + 11)] & (uint) publicva.Bit5) > 0U)
|
|
{
|
|
if (Operators.CompareString(TextBoxPassword.Text, Right1, false) == 0)
|
|
{
|
|
if (Operators.CompareString(TextBox_NewPassword_R.Text, TextBox_EnterPassword_R.Text, false) == 0)
|
|
{
|
|
Encoding.ASCII.GetBytes(TextBox_NewPassword_R.Text.PadRight(16), 0, 16, publicva.EEPROM_Byte, 60);
|
|
}
|
|
else
|
|
{
|
|
MyProject.Forms.ChannelMsg.Msgbox_Msg("输入密码不同!", "Enter a password different!");
|
|
TextBox_NewPassword_R.Text = "";
|
|
TextBox_EnterPassword_R.Text = "";
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MyProject.Forms.ChannelMsg.Msgbox_Msg("旧密码不对!", "The old password is wrong!");
|
|
TextBoxPassword.Text = "";
|
|
TextBox_NewPassword_R.Text = "";
|
|
TextBox_EnterPassword_R.Text = "";
|
|
return;
|
|
}
|
|
}
|
|
else if (Operators.CompareString(TextBox_NewPassword_R.Text, TextBox_EnterPassword_R.Text, false) == 0)
|
|
{
|
|
Encoding.ASCII.GetBytes(TextBox_NewPassword_R.Text.PadRight(16), 0, 16, publicva.EEPROM_Byte, 60);
|
|
}
|
|
else
|
|
{
|
|
MyProject.Forms.ChannelMsg.Msgbox_Msg("输入密码不同!", "Enter a password different!");
|
|
TextBox_NewPassword_R.Text = "";
|
|
TextBox_EnterPassword_R.Text = "";
|
|
return;
|
|
}
|
|
if (((uint) publicva.EEPROM_Byte[checked (num3 + 11)] & (uint) publicva.Bit6) > 0U)
|
|
{
|
|
if (Operators.CompareString(TextBox_OldPassword_W.Text, Right2, false) == 0)
|
|
{
|
|
if (Operators.CompareString(TextBox_NewPassword_W.Text, TextBox_EnterPassword_W.Text, false) == 0)
|
|
{
|
|
Encoding.ASCII.GetBytes(TextBox_NewPassword_W.Text.PadRight(16), 0, 16, publicva.EEPROM_Byte, 70);
|
|
}
|
|
else
|
|
{
|
|
MyProject.Forms.ChannelMsg.Msgbox_Msg("输入密码不同!", "Enter a password different!");
|
|
TextBox_NewPassword_W.Text = "";
|
|
TextBox_EnterPassword_W.Text = "";
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MyProject.Forms.ChannelMsg.Msgbox_Msg("旧密码不对!", "The old password is wrong!");
|
|
TextBox_OldPassword_W.Text = "";
|
|
TextBox_NewPassword_W.Text = "";
|
|
TextBox_EnterPassword_W.Text = "";
|
|
return;
|
|
}
|
|
}
|
|
else if (Operators.CompareString(TextBox_NewPassword_W.Text, TextBox_EnterPassword_W.Text, false) == 0)
|
|
{
|
|
Encoding.ASCII.GetBytes(TextBox_NewPassword_W.Text.PadRight(16), 0, 16, publicva.EEPROM_Byte, 70);
|
|
}
|
|
else
|
|
{
|
|
MyProject.Forms.ChannelMsg.Msgbox_Msg("输入密码不同!", "Enter a password different!");
|
|
TextBox_NewPassword_W.Text = "";
|
|
TextBox_EnterPassword_W.Text = "";
|
|
return;
|
|
}
|
|
publicva.EEPROM_Byte[checked (num3 + 11)] = Operators.CompareString(TextBox_NewPassword_R.Text, "", false) != 0 ? (byte) ((int) publicva.EEPROM_Byte[checked (num3 + 11)] | (int) publicva.Bit5) : (byte) ((int) publicva.EEPROM_Byte[checked (num3 + 11)] & (int) ~publicva.Bit5);
|
|
publicva.EEPROM_Byte[checked (num3 + 11)] = Operators.CompareString(TextBox_NewPassword_W.Text, "", false) != 0 ? (byte) ((int) publicva.EEPROM_Byte[checked (num3 + 11)] | (int) publicva.Bit6) : (byte) ((int) publicva.EEPROM_Byte[checked (num3 + 11)] & (int) ~publicva.Bit6);
|
|
if (!MyProject.Forms.MDIParent1.MSCcomm_StartInit("Write_Password", publicva.WPassword_EEPROM_Add_Lendgth_List))
|
|
;
|
|
Close();
|
|
}
|
|
|
|
private void CheckBox_ReadPassword_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (CheckBox_ReadPassword.Checked)
|
|
{
|
|
GroupBox_ReadPassword.Enabled = true;
|
|
}
|
|
else
|
|
{
|
|
GroupBox_ReadPassword.Enabled = false;
|
|
TextBoxPassword.Text = "";
|
|
TextBox_NewPassword_R.Text = "";
|
|
TextBox_EnterPassword_R.Text = "";
|
|
}
|
|
}
|
|
|
|
private void CheckBox_WritePassword_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (CheckBox_WritePassword.Checked)
|
|
{
|
|
GroupBox_WritePassword.Enabled = true;
|
|
}
|
|
else
|
|
{
|
|
GroupBox_WritePassword.Enabled = false;
|
|
TextBox_OldPassword_W.Text = "";
|
|
TextBox_NewPassword_W.Text = "";
|
|
TextBox_EnterPassword_W.Text = "";
|
|
}
|
|
}
|
|
}
|
|
}
|