// 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() { this.Load += new EventHandler(this.PasswordForm_Load); PasswordForm.__ENCList.Add((object) new WeakReference((object) this)); this.InitializeComponent(); } [DebuggerNonUserCode] protected override void Dispose(bool disposing) { if (disposing && this.components != null) this.components.Dispose(); base.Dispose(disposing); } [DebuggerStepThrough] private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (PasswordForm)); this.Label1 = new Label(); this.TextBoxPassword = new TextBox(); this.ButtonOK = new Button(); this.ButtonCannel = new Button(); this.Label2 = new Label(); this.TextBox_NewPassword_R = new TextBox(); this.CheckBox_WritePassword = new CheckBox(); this.CheckBox_ReadPassword = new CheckBox(); this.GroupBox_ReadPassword = new GroupBox(); this.Label3 = new Label(); this.TextBox_EnterPassword_R = new TextBox(); this.GroupBox_WritePassword = new GroupBox(); this.TextBox_OldPassword_W = new TextBox(); this.Label4 = new Label(); this.Label5 = new Label(); this.Label6 = new Label(); this.TextBox_EnterPassword_W = new TextBox(); this.TextBox_NewPassword_W = new TextBox(); this.GroupBox_ReadPassword.SuspendLayout(); this.GroupBox_WritePassword.SuspendLayout(); this.SuspendLayout(); this.Label1.AccessibleDescription = (string) null; this.Label1.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.Label1, "Label1"); this.Label1.Font = (Font) null; this.Label1.Name = "Label1"; this.TextBoxPassword.AccessibleDescription = (string) null; this.TextBoxPassword.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.TextBoxPassword, "TextBoxPassword"); this.TextBoxPassword.BackgroundImage = (Image) null; this.TextBoxPassword.Font = (Font) null; this.TextBoxPassword.Name = "TextBoxPassword"; this.ButtonOK.AccessibleDescription = (string) null; this.ButtonOK.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.ButtonOK, "ButtonOK"); this.ButtonOK.BackgroundImage = (Image) null; this.ButtonOK.Font = (Font) null; this.ButtonOK.Name = "ButtonOK"; this.ButtonOK.UseVisualStyleBackColor = true; this.ButtonCannel.AccessibleDescription = (string) null; this.ButtonCannel.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.ButtonCannel, "ButtonCannel"); this.ButtonCannel.BackgroundImage = (Image) null; this.ButtonCannel.Font = (Font) null; this.ButtonCannel.Name = "ButtonCannel"; this.ButtonCannel.UseVisualStyleBackColor = true; this.Label2.AccessibleDescription = (string) null; this.Label2.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.Label2, "Label2"); this.Label2.Font = (Font) null; this.Label2.Name = "Label2"; this.TextBox_NewPassword_R.AccessibleDescription = (string) null; this.TextBox_NewPassword_R.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.TextBox_NewPassword_R, "TextBox_NewPassword_R"); this.TextBox_NewPassword_R.BackgroundImage = (Image) null; this.TextBox_NewPassword_R.Font = (Font) null; this.TextBox_NewPassword_R.Name = "TextBox_NewPassword_R"; this.CheckBox_WritePassword.AccessibleDescription = (string) null; this.CheckBox_WritePassword.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.CheckBox_WritePassword, "CheckBox_WritePassword"); this.CheckBox_WritePassword.BackgroundImage = (Image) null; this.CheckBox_WritePassword.Font = (Font) null; this.CheckBox_WritePassword.Name = "CheckBox_WritePassword"; this.CheckBox_WritePassword.UseVisualStyleBackColor = true; this.CheckBox_ReadPassword.AccessibleDescription = (string) null; this.CheckBox_ReadPassword.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.CheckBox_ReadPassword, "CheckBox_ReadPassword"); this.CheckBox_ReadPassword.BackgroundImage = (Image) null; this.CheckBox_ReadPassword.Font = (Font) null; this.CheckBox_ReadPassword.Name = "CheckBox_ReadPassword"; this.CheckBox_ReadPassword.UseVisualStyleBackColor = true; this.GroupBox_ReadPassword.AccessibleDescription = (string) null; this.GroupBox_ReadPassword.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.GroupBox_ReadPassword, "GroupBox_ReadPassword"); this.GroupBox_ReadPassword.BackgroundImage = (Image) null; this.GroupBox_ReadPassword.Controls.Add((Control) this.TextBoxPassword); this.GroupBox_ReadPassword.Controls.Add((Control) this.Label1); this.GroupBox_ReadPassword.Controls.Add((Control) this.Label3); this.GroupBox_ReadPassword.Controls.Add((Control) this.Label2); this.GroupBox_ReadPassword.Controls.Add((Control) this.TextBox_EnterPassword_R); this.GroupBox_ReadPassword.Controls.Add((Control) this.TextBox_NewPassword_R); this.GroupBox_ReadPassword.Font = (Font) null; this.GroupBox_ReadPassword.Name = "GroupBox_ReadPassword"; this.GroupBox_ReadPassword.TabStop = false; this.Label3.AccessibleDescription = (string) null; this.Label3.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.Label3, "Label3"); this.Label3.Font = (Font) null; this.Label3.Name = "Label3"; this.TextBox_EnterPassword_R.AccessibleDescription = (string) null; this.TextBox_EnterPassword_R.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.TextBox_EnterPassword_R, "TextBox_EnterPassword_R"); this.TextBox_EnterPassword_R.BackgroundImage = (Image) null; this.TextBox_EnterPassword_R.Font = (Font) null; this.TextBox_EnterPassword_R.Name = "TextBox_EnterPassword_R"; this.GroupBox_WritePassword.AccessibleDescription = (string) null; this.GroupBox_WritePassword.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.GroupBox_WritePassword, "GroupBox_WritePassword"); this.GroupBox_WritePassword.BackgroundImage = (Image) null; this.GroupBox_WritePassword.Controls.Add((Control) this.TextBox_OldPassword_W); this.GroupBox_WritePassword.Controls.Add((Control) this.Label4); this.GroupBox_WritePassword.Controls.Add((Control) this.Label5); this.GroupBox_WritePassword.Controls.Add((Control) this.Label6); this.GroupBox_WritePassword.Controls.Add((Control) this.TextBox_EnterPassword_W); this.GroupBox_WritePassword.Controls.Add((Control) this.TextBox_NewPassword_W); this.GroupBox_WritePassword.Font = (Font) null; this.GroupBox_WritePassword.Name = "GroupBox_WritePassword"; this.GroupBox_WritePassword.TabStop = false; this.TextBox_OldPassword_W.AccessibleDescription = (string) null; this.TextBox_OldPassword_W.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.TextBox_OldPassword_W, "TextBox_OldPassword_W"); this.TextBox_OldPassword_W.BackgroundImage = (Image) null; this.TextBox_OldPassword_W.Font = (Font) null; this.TextBox_OldPassword_W.Name = "TextBox_OldPassword_W"; this.Label4.AccessibleDescription = (string) null; this.Label4.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.Label4, "Label4"); this.Label4.Font = (Font) null; this.Label4.Name = "Label4"; this.Label5.AccessibleDescription = (string) null; this.Label5.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.Label5, "Label5"); this.Label5.Font = (Font) null; this.Label5.Name = "Label5"; this.Label6.AccessibleDescription = (string) null; this.Label6.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.Label6, "Label6"); this.Label6.Font = (Font) null; this.Label6.Name = "Label6"; this.TextBox_EnterPassword_W.AccessibleDescription = (string) null; this.TextBox_EnterPassword_W.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.TextBox_EnterPassword_W, "TextBox_EnterPassword_W"); this.TextBox_EnterPassword_W.BackgroundImage = (Image) null; this.TextBox_EnterPassword_W.Font = (Font) null; this.TextBox_EnterPassword_W.Name = "TextBox_EnterPassword_W"; this.TextBox_NewPassword_W.AccessibleDescription = (string) null; this.TextBox_NewPassword_W.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this.TextBox_NewPassword_W, "TextBox_NewPassword_W"); this.TextBox_NewPassword_W.BackgroundImage = (Image) null; this.TextBox_NewPassword_W.Font = (Font) null; this.TextBox_NewPassword_W.Name = "TextBox_NewPassword_W"; this.AccessibleDescription = (string) null; this.AccessibleName = (string) null; componentResourceManager.ApplyResources((object) this, "$this"); this.AutoScaleMode = AutoScaleMode.Font; this.BackgroundImage = (Image) null; this.Controls.Add((Control) this.GroupBox_WritePassword); this.Controls.Add((Control) this.GroupBox_ReadPassword); this.Controls.Add((Control) this.CheckBox_ReadPassword); this.Controls.Add((Control) this.CheckBox_WritePassword); this.Controls.Add((Control) this.ButtonCannel); this.Controls.Add((Control) this.ButtonOK); this.Font = (Font) null; this.FormBorderStyle = FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = nameof (PasswordForm); this.GroupBox_ReadPassword.ResumeLayout(false); this.GroupBox_ReadPassword.PerformLayout(); this.GroupBox_WritePassword.ResumeLayout(false); this.GroupBox_WritePassword.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } internal virtual Label Label1 { [DebuggerNonUserCode] get => this._Label1; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label1 = value; } internal virtual TextBox TextBoxPassword { [DebuggerNonUserCode] get => this._TextBoxPassword; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { this._TextBoxPassword = value; } } internal virtual Button ButtonOK { [DebuggerNonUserCode] get => this._ButtonOK; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { if (this._ButtonOK != null) this._ButtonOK.Click -= new EventHandler(this.ButtonOK_Click); this._ButtonOK = value; if (this._ButtonOK == null) return; this._ButtonOK.Click += new EventHandler(this.ButtonOK_Click); } } internal virtual Button ButtonCannel { [DebuggerNonUserCode] get => this._ButtonCannel; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { if (this._ButtonCannel != null) this._ButtonCannel.Click -= new EventHandler(this.ButtonCannel_Click); this._ButtonCannel = value; if (this._ButtonCannel == null) return; this._ButtonCannel.Click += new EventHandler(this.ButtonCannel_Click); } } internal virtual Label Label2 { [DebuggerNonUserCode] get => this._Label2; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label2 = value; } internal virtual TextBox TextBox_NewPassword_R { [DebuggerNonUserCode] get => this._TextBox_NewPassword_R; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { this._TextBox_NewPassword_R = value; } } internal virtual CheckBox CheckBox_WritePassword { [DebuggerNonUserCode] get => this._CheckBox_WritePassword; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { if (this._CheckBox_WritePassword != null) this._CheckBox_WritePassword.CheckedChanged -= new EventHandler(this.CheckBox_WritePassword_CheckedChanged); this._CheckBox_WritePassword = value; if (this._CheckBox_WritePassword == null) return; this._CheckBox_WritePassword.CheckedChanged += new EventHandler(this.CheckBox_WritePassword_CheckedChanged); } } internal virtual CheckBox CheckBox_ReadPassword { [DebuggerNonUserCode] get => this._CheckBox_ReadPassword; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { if (this._CheckBox_ReadPassword != null) this._CheckBox_ReadPassword.CheckedChanged -= new EventHandler(this.CheckBox_ReadPassword_CheckedChanged); this._CheckBox_ReadPassword = value; if (this._CheckBox_ReadPassword == null) return; this._CheckBox_ReadPassword.CheckedChanged += new EventHandler(this.CheckBox_ReadPassword_CheckedChanged); } } internal virtual GroupBox GroupBox_ReadPassword { [DebuggerNonUserCode] get => this._GroupBox_ReadPassword; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { this._GroupBox_ReadPassword = value; } } internal virtual Label Label3 { [DebuggerNonUserCode] get => this._Label3; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label3 = value; } internal virtual TextBox TextBox_EnterPassword_R { [DebuggerNonUserCode] get => this._TextBox_EnterPassword_R; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { this._TextBox_EnterPassword_R = value; } } internal virtual GroupBox GroupBox_WritePassword { [DebuggerNonUserCode] get => this._GroupBox_WritePassword; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { this._GroupBox_WritePassword = value; } } internal virtual TextBox TextBox_OldPassword_W { [DebuggerNonUserCode] get => this._TextBox_OldPassword_W; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { this._TextBox_OldPassword_W = value; } } internal virtual Label Label4 { [DebuggerNonUserCode] get => this._Label4; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label4 = value; } internal virtual Label Label5 { [DebuggerNonUserCode] get => this._Label5; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label5 = value; } internal virtual Label Label6 { [DebuggerNonUserCode] get => this._Label6; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set => this._Label6 = value; } internal virtual TextBox TextBox_EnterPassword_W { [DebuggerNonUserCode] get => this._TextBox_EnterPassword_W; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { this._TextBox_EnterPassword_W = value; } } internal virtual TextBox TextBox_NewPassword_W { [DebuggerNonUserCode] get => this._TextBox_NewPassword_W; [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set { this._TextBox_NewPassword_W = value; } } private void PasswordForm_Load(object sender, EventArgs e) { int num = 0; MyProject.Forms.MDIParent1.SetControl_U8_Data((Control) this.CheckBox_ReadPassword, checked (num + 11), publicva.Bit5, 0); MyProject.Forms.MDIParent1.SetControl_U8_Data((Control) this.CheckBox_WritePassword, checked (num + 11), publicva.Bit6, 0); this.CheckBox_ReadPassword_CheckedChanged(RuntimeHelpers.GetObjectValue(sender), e); this.CheckBox_WritePassword_CheckedChanged(RuntimeHelpers.GetObjectValue(sender), e); } private void ButtonCannel_Click(object sender, EventArgs e) => this.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(this.TextBoxPassword.Text, Right1, false) == 0) { if (Operators.CompareString(this.TextBox_NewPassword_R.Text, this.TextBox_EnterPassword_R.Text, false) == 0) { Encoding.ASCII.GetBytes(this.TextBox_NewPassword_R.Text.PadRight(16), 0, 16, publicva.EEPROM_Byte, 60); } else { MyProject.Forms.ChannelMsg.Msgbox_Msg("输入密码不同!", "Enter a password different!"); this.TextBox_NewPassword_R.Text = ""; this.TextBox_EnterPassword_R.Text = ""; return; } } else { MyProject.Forms.ChannelMsg.Msgbox_Msg("旧密码不对!", "The old password is wrong!"); this.TextBoxPassword.Text = ""; this.TextBox_NewPassword_R.Text = ""; this.TextBox_EnterPassword_R.Text = ""; return; } } else if (Operators.CompareString(this.TextBox_NewPassword_R.Text, this.TextBox_EnterPassword_R.Text, false) == 0) { Encoding.ASCII.GetBytes(this.TextBox_NewPassword_R.Text.PadRight(16), 0, 16, publicva.EEPROM_Byte, 60); } else { MyProject.Forms.ChannelMsg.Msgbox_Msg("输入密码不同!", "Enter a password different!"); this.TextBox_NewPassword_R.Text = ""; this.TextBox_EnterPassword_R.Text = ""; return; } if (((uint) publicva.EEPROM_Byte[checked (num3 + 11)] & (uint) publicva.Bit6) > 0U) { if (Operators.CompareString(this.TextBox_OldPassword_W.Text, Right2, false) == 0) { if (Operators.CompareString(this.TextBox_NewPassword_W.Text, this.TextBox_EnterPassword_W.Text, false) == 0) { Encoding.ASCII.GetBytes(this.TextBox_NewPassword_W.Text.PadRight(16), 0, 16, publicva.EEPROM_Byte, 70); } else { MyProject.Forms.ChannelMsg.Msgbox_Msg("输入密码不同!", "Enter a password different!"); this.TextBox_NewPassword_W.Text = ""; this.TextBox_EnterPassword_W.Text = ""; return; } } else { MyProject.Forms.ChannelMsg.Msgbox_Msg("旧密码不对!", "The old password is wrong!"); this.TextBox_OldPassword_W.Text = ""; this.TextBox_NewPassword_W.Text = ""; this.TextBox_EnterPassword_W.Text = ""; return; } } else if (Operators.CompareString(this.TextBox_NewPassword_W.Text, this.TextBox_EnterPassword_W.Text, false) == 0) { Encoding.ASCII.GetBytes(this.TextBox_NewPassword_W.Text.PadRight(16), 0, 16, publicva.EEPROM_Byte, 70); } else { MyProject.Forms.ChannelMsg.Msgbox_Msg("输入密码不同!", "Enter a password different!"); this.TextBox_NewPassword_W.Text = ""; this.TextBox_EnterPassword_W.Text = ""; return; } publicva.EEPROM_Byte[checked (num3 + 11)] = Operators.CompareString(this.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(this.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)) ; this.Close(); } private void CheckBox_ReadPassword_CheckedChanged(object sender, EventArgs e) { if (this.CheckBox_ReadPassword.Checked) { this.GroupBox_ReadPassword.Enabled = true; } else { this.GroupBox_ReadPassword.Enabled = false; this.TextBoxPassword.Text = ""; this.TextBox_NewPassword_R.Text = ""; this.TextBox_EnterPassword_R.Text = ""; } } private void CheckBox_WritePassword_CheckedChanged(object sender, EventArgs e) { if (this.CheckBox_WritePassword.Checked) { this.GroupBox_WritePassword.Enabled = true; } else { this.GroupBox_WritePassword.Enabled = false; this.TextBox_OldPassword_W.Text = ""; this.TextBox_NewPassword_W.Text = ""; this.TextBox_EnterPassword_W.Text = ""; } } } }