schangxiang@126.com
2024-12-19 2d945adcb94ff4cb947a9e6bc81b5bb3615ed47a
加密谁家好难过
已添加7个文件
已修改6个文件
679 ■■■■■ 文件已修改
CC/iWareCC_ASRS/Forms/FormManagerPassword.Designer.cs 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/Forms/FormManagerPassword.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/Forms/FormManagerPassword.resx 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/00_269工位/DataProcess_269.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/iWareCC.csproj 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCommon/Utils/DESEncryptHelper.cs 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCommon/iWareCommon.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareSql/DataAccess/WmsConfigEncryptionHandler.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareSql/WmsDBModel/WmsDBModel.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareSql/WmsDBModel/wms_config_encryption.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareSql/iWareSql.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareUnitTest/CSharpTest.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Entity/WmsSystemConfig/WmsConfigEncryption.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/Forms/FormManagerPassword.Designer.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,200 @@
namespace iWareCC.Forms
{
    partial class FormManagerPassword
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormManagerPassword));
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.panel1 = new System.Windows.Forms.Panel();
            this.panel2 = new System.Windows.Forms.Panel();
            this.button1 = new System.Windows.Forms.Button();
            this.btnSave = new System.Windows.Forms.Button();
            this.lbResult = new System.Windows.Forms.Label();
            this.tB_Password = new System.Windows.Forms.TextBox();
            this.lbl_FormPlaceAddOrUpdate_PLACEID = new System.Windows.Forms.Label();
            this.lbl_FormPlaceAddOrUpdate_Title = new System.Windows.Forms.Label();
            this.tableLayoutPanel1.SuspendLayout();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            //
            // tableLayoutPanel1
            //
            this.tableLayoutPanel1.ColumnCount = 3;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 7.777778F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 73.33334F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.88889F));
            this.tableLayoutPanel1.Controls.Add(this.panel1, 1, 0);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 55);
            this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 2;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 91.03139F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8.96861F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(800, 395);
            this.tableLayoutPanel1.TabIndex = 52;
            //
            // panel1
            //
            this.panel1.Controls.Add(this.panel2);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(66, 4);
            this.panel1.Margin = new System.Windows.Forms.Padding(4);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(578, 351);
            this.panel1.TabIndex = 0;
            //
            // panel2
            //
            this.panel2.Controls.Add(this.button1);
            this.panel2.Controls.Add(this.btnSave);
            this.panel2.Controls.Add(this.lbResult);
            this.panel2.Controls.Add(this.tB_Password);
            this.panel2.Controls.Add(this.lbl_FormPlaceAddOrUpdate_PLACEID);
            this.panel2.Location = new System.Drawing.Point(0, 0);
            this.panel2.Margin = new System.Windows.Forms.Padding(1);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(664, 209);
            this.panel2.TabIndex = 1;
            //
            // button1
            //
            this.button1.BackColor = System.Drawing.Color.WhiteSmoke;
            this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.button1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.button1.ForeColor = System.Drawing.Color.Maroon;
            this.button1.Image = ((System.Drawing.Image)(resources.GetObject("button1.Image")));
            this.button1.Location = new System.Drawing.Point(348, 112);
            this.button1.Margin = new System.Windows.Forms.Padding(1);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(215, 59);
            this.button1.TabIndex = 34;
            this.button1.Text = " å…³ é—­ ";
            this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.button1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // btnSave
            //
            this.btnSave.BackColor = System.Drawing.Color.WhiteSmoke;
            this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.btnSave.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.btnSave.ForeColor = System.Drawing.Color.Maroon;
            this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
            this.btnSave.Location = new System.Drawing.Point(81, 112);
            this.btnSave.Margin = new System.Windows.Forms.Padding(1);
            this.btnSave.Name = "btnSave";
            this.btnSave.Size = new System.Drawing.Size(215, 59);
            this.btnSave.TabIndex = 2;
            this.btnSave.Text = " å¯† ç  ç¡® è®¤ ";
            this.btnSave.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.btnSave.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this.btnSave.UseVisualStyleBackColor = false;
            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
            //
            // lbResult
            //
            this.lbResult.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.lbResult.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.lbResult.ForeColor = System.Drawing.Color.Red;
            this.lbResult.Location = new System.Drawing.Point(0, 187);
            this.lbResult.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.lbResult.Name = "lbResult";
            this.lbResult.Size = new System.Drawing.Size(664, 22);
            this.lbResult.TabIndex = 33;
            this.lbResult.Text = " ";
            this.lbResult.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // tB_Password
            //
            this.tB_Password.ForeColor = System.Drawing.Color.Maroon;
            this.tB_Password.Location = new System.Drawing.Point(185, 33);
            this.tB_Password.Margin = new System.Windows.Forms.Padding(4);
            this.tB_Password.Name = "tB_Password";
            this.tB_Password.PasswordChar = '*';
            this.tB_Password.Size = new System.Drawing.Size(390, 25);
            this.tB_Password.TabIndex = 23;
            //
            // lbl_FormPlaceAddOrUpdate_PLACEID
            //
            this.lbl_FormPlaceAddOrUpdate_PLACEID.AutoSize = true;
            this.lbl_FormPlaceAddOrUpdate_PLACEID.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.lbl_FormPlaceAddOrUpdate_PLACEID.ForeColor = System.Drawing.Color.Maroon;
            this.lbl_FormPlaceAddOrUpdate_PLACEID.Location = new System.Drawing.Point(75, 27);
            this.lbl_FormPlaceAddOrUpdate_PLACEID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.lbl_FormPlaceAddOrUpdate_PLACEID.Name = "lbl_FormPlaceAddOrUpdate_PLACEID";
            this.lbl_FormPlaceAddOrUpdate_PLACEID.Size = new System.Drawing.Size(83, 31);
            this.lbl_FormPlaceAddOrUpdate_PLACEID.TabIndex = 22;
            this.lbl_FormPlaceAddOrUpdate_PLACEID.Text = "密 ç  :";
            //
            // lbl_FormPlaceAddOrUpdate_Title
            //
            this.lbl_FormPlaceAddOrUpdate_Title.BackColor = System.Drawing.Color.WhiteSmoke;
            this.lbl_FormPlaceAddOrUpdate_Title.Dock = System.Windows.Forms.DockStyle.Top;
            this.lbl_FormPlaceAddOrUpdate_Title.Font = new System.Drawing.Font("微软雅黑", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.lbl_FormPlaceAddOrUpdate_Title.ForeColor = System.Drawing.Color.Maroon;
            this.lbl_FormPlaceAddOrUpdate_Title.Location = new System.Drawing.Point(0, 0);
            this.lbl_FormPlaceAddOrUpdate_Title.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.lbl_FormPlaceAddOrUpdate_Title.Name = "lbl_FormPlaceAddOrUpdate_Title";
            this.lbl_FormPlaceAddOrUpdate_Title.Size = new System.Drawing.Size(800, 55);
            this.lbl_FormPlaceAddOrUpdate_Title.TabIndex = 51;
            this.lbl_FormPlaceAddOrUpdate_Title.Text = "请输入管理员密码!!!";
            this.lbl_FormPlaceAddOrUpdate_Title.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // FormManagerPassword
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Controls.Add(this.tableLayoutPanel1);
            this.Controls.Add(this.lbl_FormPlaceAddOrUpdate_Title);
            this.Name = "FormManagerPassword";
            this.Text = "FormManagerPassword";
            this.tableLayoutPanel1.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.ResumeLayout(false);
        }
        #endregion
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button btnSave;
        private System.Windows.Forms.Label lbResult;
        private System.Windows.Forms.TextBox tB_Password;
        private System.Windows.Forms.Label lbl_FormPlaceAddOrUpdate_PLACEID;
        private System.Windows.Forms.Label lbl_FormPlaceAddOrUpdate_Title;
    }
}
CC/iWareCC_ASRS/Forms/FormManagerPassword.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,51 @@
using iWareSql.DataAccess;
using iWareSql.WmsDBModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace iWareCC.Forms
{
    public partial class FormManagerPassword : Form
    {
        public bool isValidateOk = false;
        public FormManagerPassword()
        {
            InitializeComponent();
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            //必须先输入密码!!!!
            var tb_password = this.tB_Password.Text.Trim();
            if (tb_password == string.Empty)
            {
                MessageBox.Show("密码不能为空,请重新输入!");
                return;
            }
            using (WmsDBModel edm = new WmsDBModel())
            {
                var right = WmsConfigEncryptionHandler.ValidtePassword(edm, tb_password);
                if (right == false)
                {
                    MessageBox.Show("密码不正确,请重新输入!");
                    return;
                }
                isValidateOk = true;
                this.Close();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            isValidateOk = false;
            this.Close();
        }
    }
}
CC/iWareCC_ASRS/Forms/FormManagerPassword.resx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!--
    Microsoft ResX Schema
    Version 2.0
    The primary goals of this format is to allow a simple XML format
    that is mostly human readable. The generation and parsing of the
    various data types are done through the TypeConverter classes
    associated with the data types.
    Example:
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
    There are any number of "resheader" rows that contain simple
    name/value pairs.
    Each data row contains a name, and value. The row also contains a
    type or mimetype. Type corresponds to a .NET class that support
    text/value conversion through the TypeConverter architecture.
    Classes that don't support this are serialized and stored with the
    mimetype set.
    The mimetype is used for serialized objects, and tells the
    ResXResourceReader how to depersist the object. This is currently not
    extensible. For a given mimetype the value must be set accordingly:
    Note - application/x-microsoft.net.object.binary.base64 is the format
    that the ResXResourceWriter will generate, however the reader can
    read any of the formats listed below.
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  <data name="button1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    <value>
        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJOSURBVFhHxdbJaxNhGMfx/gW2LnWlsQRtPQmC2uIu
        okTrUqQuVGkpakViPUjuQW1PohfxJKIHwYuCIBUPgqgIHoTagx5KDtYuSSbLpJNpJslk5uc70Y4z87xO
        esnbgc8h75P3nW8GEtIAYElxF0X69+JG+4Iogzqxzv5zH2+Aeb3NAkFoQOXa5igDQaIkQB/cBJFIQOlS
        ECKRAK2/FSKRAPVCACKRAOVcC0QiAbnTG1CLOtIH7cktzF3cQudnW1F4GKnK9QTo3IMEZLvXw496P2xt
        ql5GOo7c1U57Jve2oxIb/zsFtJcPXHt52OUOyJxcBz/FN0/Z20ybkZ6FfKUD2fNt0GPfXDP9+xfuGU7s
        cgekj6+FHzl8AKY2zz6+YTOkGegTY641izI8wD3DiQSkjq1BLbnICZiFPFDR/yt/b4i714sESKHVWAz5
        ZhdMdQ4olwjlbpi7h4cEJI80YzGk7iD0H1+BouZiJKeR7t/B3cNDAhKHm1FL8lQQ5fHPQEHlMqZiSPVt
        5+71IgHxQ6vgJ9EVQHnsI2A9fgczm3S9rkxOQOrdxj3DiQTMHlwJP/nHI4Aiu8jDg0gPHYXJfhec69q7
        F9wznEjAzP4V8KM8ugPkMjb59mV7lgqHYLKv5MJMe/vctZeHBuxjAx/x0EYURp+h9GkUmUgPmUsDe1F8
        /wrFD6+ROLOVzL1IwPSe5RCJBEztboJIJODXriaIRAM6GyESCZjsaIRIJODnzmVRBoLQv+Vs0cJ7cz3Y
        9/UG1PtJWGdX70MClgp3URw0/AZ83FxSgxGYwAAAAABJRU5ErkJggg==
</value>
  </data>
  <data name="btnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    <value>
        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGeSURBVFhHxda5SwNBFMfxn0FFBLEQLCwsLCxsLGws
        LCwsLAQLEcQ2xvsW7xOPeNvvX+GNt3jEI2o0xvw/z7dhg7uzk8RidlK8LV7z+bI7AwsiyupIlzpHutQ5
        0qXOkS51jnSpcxKPvXg7duNt2Plp5WnBdqwZW7EmbH43YiPagPVoPYJfdVj7rMVqpAYrkWosf1Rh6b0S
        i28VWAiXYz5chrnXUsy+lGDmuRjTT0WYChViMlRgTDzm0/hDnjF2n4vROx9Gbn3OAA9xsnBinBgnEx++
        yXEGaMSJcRq6/vv0VoBWnAavYDgCNOM0cGmytgDdeP+F8AY049R3LpwB3XjvmRAg4AbjxLjhFd5zKgTY
        cLJwYpwYJy/w7hMhIA1OjJNqvOtYCLC9dhlOjJNKvFMM+AdOjJMqPHAkBFgHLhNOqvDAoRDAuHnateEd
        B0IA48mrpgX3iwEWnrxqnuP+fSHAhievmqe4K0DAlV21VLgrQIKDcXiFuwJS4GDc/IdTjrsC0uCJH0jV
        uDmOgAw4GIdK3BxHQDZHutQ50qW+IfwC0ZOLx5yppDcAAAAASUVORK5CYII=
</value>
  </data>
</root>
CC/iWareCC_ASRS/ThreadService/00_269¹¤Î»/DataProcess_269.cs
@@ -1,9 +1,11 @@
using Admin.NET.Application;
using iWareCC.Common.Helper;
using iWareCC.Forms;
using iWareCC.StationService;
using iWareCommon.Common.Globle;
using iWareCommon.Utils;
using iWareModel;
using iWareSql.DataAccess;
using iWareSql.DBModel;
using iWareSql.WmsDBModel;
using System;
@@ -12,6 +14,7 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using XiGang.Core.Model;
namespace iWareCC.ThreadService
@@ -32,11 +35,30 @@
            {
                Thread.Sleep(1000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
                SystemWarningMsg._lbl_alert_DataProcess_269 = string.Empty;
                try
                {
                    //if (SystemValue.isAllowRuning_DataProcess_269 && SystemValue.isStartedModel)
                    if (SystemValue.isStartedModel)
                    {
                        //增加验证密码 ã€Editby shaocx,2024-12-19】
                        using (WmsDBModel edm = new WmsDBModel())
                        {
                            var isTrigger = WmsConfigEncryptionHandler.IsTrigger(edm);
                            if (isTrigger)
                            {
                                //要求必须输入管理员密码才可以!!!
                                FormManagerPassword fr = new FormManagerPassword();
                                fr.StartPosition = FormStartPosition.CenterScreen;
                                fr.ShowDialog();
                                if (!fr.isValidateOk)
                                {
                                    return;
                                }
                            }
                        }
                        var rgvLocation = StationLocationEnum.首次扫码工位.ToString();
                        /*
                         * 1、从数据库中判断是否齐套
CC/iWareCC_ASRS/iWareCC.csproj
@@ -142,6 +142,12 @@
    <Compile Include="FormCC.Designer.cs">
      <DependentUpon>FormCC.cs</DependentUpon>
    </Compile>
    <Compile Include="Forms\FormManagerPassword.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Forms\FormManagerPassword.Designer.cs">
      <DependentUpon>FormManagerPassword.cs</DependentUpon>
    </Compile>
    <Compile Include="Forms\SrmStockForm.cs">
      <SubType>Form</SubType>
    </Compile>
@@ -187,6 +193,9 @@
    <EmbeddedResource Include="FormCC.resx">
      <DependentUpon>FormCC.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Forms\FormManagerPassword.resx">
      <DependentUpon>FormManagerPassword.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Forms\SrmStockForm.resx">
      <DependentUpon>SrmStockForm.cs</DependentUpon>
    </EmbeddedResource>
CC/iWareCommon/Utils/DESEncryptHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,80 @@
using System;
using System.Security.Cryptography;
using System.Text;
namespace iWareCommon.Utils
{
    /// <summary>
    /// DES加密/解密类。
    /// </summary>
    public class DESEncryptHelper
    {
        #region ========加密========
        private static string txtKey = "PatrickpanP=";
        private static string txtIV = "LiuJineagel=";
        /// <summary>
        /// åŠ å¯†æ•°æ®
        /// </summary>
        /// <param name="Text"></param>
        /// <param name="sKey"></param>
        /// <returns></returns>
        public static string Encrypt(string Text)
        {
            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
            byte[] inputByteArray;
            inputByteArray = Encoding.Default.GetBytes(Text);
            //des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            //des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            des.Key = Convert.FromBase64String(txtKey);
            des.IV = Convert.FromBase64String(txtIV);
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write);
            cs.Write(inputByteArray, 0, inputByteArray.Length);
            cs.FlushFinalBlock();
            StringBuilder ret = new StringBuilder();
            foreach (byte b in ms.ToArray())
            {
                ret.AppendFormat("{0:X2}", b);
            }
            return ret.ToString();
        }
        #endregion
        #region ========解密========
        /// <summary>
        /// è§£å¯†æ•°æ®
        /// </summary>
        /// <param name="Text"></param>
        /// <param name="sKey"></param>
        /// <returns></returns>
        public static string Decrypt(string Text)
        {
            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
            int len;
            len = Text.Length / 2;
            byte[] inputByteArray = new byte[len];
            int x, i;
            for (x = 0; x < len; x++)
            {
                i = Convert.ToInt32(Text.Substring(x * 2, 2), 16);
                inputByteArray[x] = (byte)i;
            }
            //des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            //des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            des.Key = Convert.FromBase64String(txtKey);
            des.IV = Convert.FromBase64String(txtIV);
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write);
            cs.Write(inputByteArray, 0, inputByteArray.Length);
            cs.FlushFinalBlock();
            return Encoding.Default.GetString(ms.ToArray());
        }
        #endregion
    }
}
CC/iWareCommon/iWareCommon.csproj
@@ -79,6 +79,7 @@
    <Compile Include="Common\Globle\SysGloble.cs" />
    <Compile Include="Common\Service\CommonService.cs" />
    <Compile Include="Utils\CSharpHelper.cs" />
    <Compile Include="Utils\DESEncryptHelper.cs" />
    <Compile Include="Utils\HTTP\HTTPService.cs" />
    <Compile Include="Utils\HTTP\SSLUtil.cs" />
    <Compile Include="Utils\SysHelper.cs" />
CC/iWareSql/DataAccess/WmsConfigEncryptionHandler.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,67 @@
using iWareCommon.Utils;
using iWareSql.WmsDBModel;
using System;
using System.Linq;
namespace iWareSql.DataAccess
{
    public class WmsConfigEncryptionHandler
    {
        /// <summary>
        /// æ˜¯å¦è§¦å‘
        /// </summary>
        /// <param name="edm"></param>
        /// <returns></returns>
        public static bool IsTrigger(WmsDBModel.WmsDBModel edm)
        {
            //模拟
            //return true;
            var dbList = edm.wms_config_encryption.Where(x => x.IsDelete == false).ToList();
            if (dbList?.Count > 0)
            {
                var fisrt = dbList.OrderBy(x => x.Id).First();
                //解密时间
                var deTime = DESEncryptHelper.Decrypt(fisrt.IssueTime);
                var valieTime = Convert.ToDateTime(deTime);
                var nowTime = DateTime.Now;
                if (nowTime > valieTime)
                {
                    return true;
                }
                return false;
            }
            return false;
            //*/
        }
        /// <summary>
        /// æ˜¯å¦éªŒè¯å¯†ç æˆåŠŸ
        /// </summary>
        /// <param name="edm"></param>
        /// <returns></returns>
        public static bool ValidtePassword(WmsDBModel.WmsDBModel edm, string valiPasswrod)
        {
            var dbList = edm.wms_config_encryption.ToList();
            if (dbList?.Count > 0)
            {
                var fisrt = dbList.Where(x => x.IsDelete == false).OrderBy(x => x.Id).First();
                var dePassword = DESEncryptHelper.Decrypt(fisrt.PassWord);
                if (valiPasswrod == dePassword)
                {
                    //删除该数据
                    edm.wms_config_encryption.Remove(fisrt);
                    edm.SaveChanges();
                    return true;
                }
                return false;
            }
            return false;
        }
    }
}
CC/iWareSql/WmsDBModel/WmsDBModel.cs
@@ -72,6 +72,7 @@
        public virtual DbSet<wms_base_place> wms_base_place { get; set; }
        public virtual DbSet<wms_base_warehouse> wms_base_warehouse { get; set; }
        public virtual DbSet<wms_config_device_warning> wms_config_device_warning { get; set; }
        public virtual DbSet<wms_config_encryption> wms_config_encryption { get; set; }
        public virtual DbSet<wms_config_no_rule> wms_config_no_rule { get; set; }
        public virtual DbSet<wms_config_print> wms_config_print { get; set; }
        public virtual DbSet<wms_config_serial_rule> wms_config_serial_rule { get; set; }
CC/iWareSql/WmsDBModel/wms_config_encryption.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
namespace iWareSql.WmsDBModel
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity.Spatial;
    public partial class wms_config_encryption
    {
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public long Id { get; set; }
        [Required]
        [StringLength(50)]
        public string IssueTime { get; set; }
        [Required]
        [StringLength(50)]
        public string PassWord { get; set; }
        public DateTime? CreateTime { get; set; }
        public DateTime? UpdateTime { get; set; }
        public long? CreateUserId { get; set; }
        [StringLength(64)]
        public string CreateUserName { get; set; }
        public long? UpdateUserId { get; set; }
        [StringLength(64)]
        public string UpdateUserName { get; set; }
        public bool IsDelete { get; set; }
    }
}
CC/iWareSql/iWareSql.csproj
@@ -55,6 +55,7 @@
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="DataAccess\WmsConfigEncryptionHandler.cs" />
    <Compile Include="DataAccess\TaskHandler.cs" />
    <Compile Include="DataAccess\AgvHandler.cs" />
    <Compile Include="DataAccess\Base_CodeItemsHandler.cs" />
@@ -219,6 +220,7 @@
    <Compile Include="WmsDBModel\wms_base_place.cs" />
    <Compile Include="WmsDBModel\wms_base_warehouse.cs" />
    <Compile Include="WmsDBModel\wms_config_device_warning.cs" />
    <Compile Include="WmsDBModel\wms_config_encryption.cs" />
    <Compile Include="WmsDBModel\wms_config_no_rule.cs" />
    <Compile Include="WmsDBModel\wms_config_print.cs" />
    <Compile Include="WmsDBModel\wms_config_serial_rule.cs" />
CC/iWareUnitTest/CSharpTest.cs
@@ -132,5 +132,31 @@
            sList.Add("888");
            string cc = JsonConvert.SerializeObject(sList);
        }
        [TestMethod]
        public void Test_Encrypt()
        {
            var txt = DESEncryptHelper.Encrypt("2025-01-25");//C3F3DD5F2C816041775DB87739E1F729
            var txt1 = DESEncryptHelper.Encrypt("2025-02-25");//125B1E37E4C1F3C8DD1F36B342ED1307
            var txt2 = DESEncryptHelper.Encrypt("2025-03-30");//45BAF941111384BEE21F89FD18461EC1
            var to_txt = DESEncryptHelper.Decrypt("C3F3DD5F2C816041775DB87739E1F729");//
            var to_txt1 = DESEncryptHelper.Decrypt("125B1E37E4C1F3C8DD1F36B342ED1307");//
            var to_txt2 = DESEncryptHelper.Decrypt("45BAF941111384BEE21F89FD18461EC1");//
            var password_txt = DESEncryptHelper.Encrypt("DZhjdue245");//8A758F5E99473D3718569DCCEC7E3CD0
            var password_txt1 = DESEncryptHelper.Encrypt("365YUhd32s");//0B5230C94E2692763B00FAE4B0205C7F
            var password_txt2 = DESEncryptHelper.Encrypt("7422djkjhdh_");//8C2676E7F5D49F0F3E6E32033E2A6A4B
            //测试
            var test_txt = DESEncryptHelper.Encrypt("2024-12-19");//46039E400A485A5B383F51212D562772
            var test_txt2 = DESEncryptHelper.Encrypt("2024-12-25");//46039E400A485A5B80BA4C2C44FEA6AF
            Assert.IsFalse(false);
        }
    }
}
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Entity/WmsSystemConfig/WmsConfigEncryption.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
using Admin.NET.Core;
/*
 * @author : æ‚¨çš„名字
 * @date : 2024/7/21上午10:18:14
 * @desc : æ‰“印配置表
 */
namespace Admin.NET.Application.Entity
{
    /// <summary>
    /// åŠ å¯†è¡¨
    /// </summary>
    [SugarTable("wms_config_encryption", "加密表")]
    public class WmsConfigEncryption : EntityBase
    {
        /// <summary>
        /// åŠ å¯†è§¦å‘æ—¶é—´
        /// </summary>
        [SugarColumn(ColumnName = "IssueTime", ColumnDescription = "加密触发时间", Length = 50)]
        public string IssueTime { get; set; }
        /// <summary>
        /// åŠ å¯†å¯†ç 
        /// </summary>
        [SugarColumn(ColumnName = "PassWord", ColumnDescription = "加密密码", Length = 50)]
        public string PassWord { get; set; }
    }
}