Пример #1
0
        public static bool SetAccessPassword(byte[] oldAccessPwd, byte[] newAccessPwd, byte[] selCode, MemoryBank selArea, out string errInfo)
        {
            errInfo = "";
            Invengo.NetAPI.Protocol.IRP1.AccessPwdConfig_6C msg = null;
            if (selCode != null)
            {
                msg = new AccessPwdConfig_6C(Antenna, oldAccessPwd, newAccessPwd, selCode, selArea);
            }
            else
            {
                msg = new AccessPwdConfig_6C(Antenna, oldAccessPwd, newAccessPwd);
            }

            if (RfReader.Send(msg))
            {
                return(true);
            }
            else
            {
                if (msg.ErrInfo == null || msg.ErrInfo == "")
                {
                    errInfo = string.Format("0x{0}", msg.StatusCode.ToString("X2"));
                }
                else
                {
                    errInfo = msg.ErrInfo;
                }
                Log.Debug(msg.ErrInfo);
            }
            return(false);
        }
Пример #2
0
        // 访问密码
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim() != textBox2.Text.Trim())
            {
                MessageBox.Show("密码不一致!");
                return;
            }

            IRP1.AccessPwdConfig_6C msg = new IRP1.AccessPwdConfig_6C(
                antenna, 
                getPwd(txtPwd.Text.Trim()), 
                getPwd(textBox1.Text.Trim()),
                tagID,
                mb);
            if (myReader.reader.Send(msg))
                MessageBox.Show("成功");
            else
                MessageBox.Show("失败" + msg.ErrInfo);           
        }