首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

关于明华kfr-35 读卡器 修改密码有关问题

2013-08-01 
关于明华kfr-35 读卡器 修改密码问题 skey ffffffffffffkey1 Encoding.ASCII.GetBytes(skey)commo

关于明华kfr-35 读卡器 修改密码问题
 skey = "ffffffffffff";
                    key1 = Encoding.ASCII.GetBytes(skey);
                    common.a_hex(key1, key2, 12);
                    st = common.rf_load_key(icdev, 0, iii, key2);
                    if (st != 0)
                    {
                        MessageBox.Show("密码装载失败!");
                        return;
                    }
                    st = common.rf_load_key(icdev, 4, iii, key2);
                    if (st != 0)
                    {
                        MessageBox.Show("密码装载失败!");
                        return;
                    }


                    common.rf_reset(icdev, 3);
                    st = common.rf_request(icdev, 1, out tagtype);
                    if (st != 0)
                    {
                        MessageBox.Show("request error!");


                        return;
                    }
                    st = common.rf_anticoll(icdev, 0, out snr);
                    if (st != 0)
                    {
                        MessageBox.Show("anticoll error!");
                        return;
                    }

                    snrstr = "";
                    snrstr = snr.ToString("X");


                    st = common.rf_select(icdev, snr, out size);
                    if (st != 0)
                    {
                        MessageBox.Show("select error!");
                        return;
                    }
                    st = common.rf_authentication(icdev, 0, iii);
                    if (st != 0)
                    {
                        MessageBox.Show("密码验证失败!");


                        return;
                    }
                    st = common.rf_authentication(icdev, 4, iii);
                    if (st != 0)
                    {
                        MessageBox.Show("密码验证失败!");
                        return;
                    }
                    skey = "fefefefefefefe";
                    key1 = Encoding.ASCII.GetBytes(skey);
                    common.a_hex(key1, key3, 30);
                    //st = common.rf_write_hex(icdev, 2, skey);
                    st = common.rf_changeb3(icdev, iii, key3, 0x04, 0x04, 0x04, 0x04, 0, key2);
                    if (st != 0)
                    {
                        MessageBox.Show("密码修改失败!");
                        return;
                    }

                    }


到了rf_changeb3 时怎么都改不了 下面是dll引用



  [DllImport("mwrf32.dll", EntryPoint = "rf_changeb3", SetLastError = true,
             CharSet = CharSet.Auto, ExactSpelling = false,
            CallingConvention = CallingConvention.StdCall)]
        public static extern Int16 rf_changeb3(int icdev, int secnr, [MarshalAs(UnmanagedType.LPArray)]byte[] keya, int b0, int b1, int b2, int b3, int bk, [MarshalAs(UnmanagedType.LPArray)]byte[] keyb);

[解决办法]
请问你装载密码是如何实现的呢??我总是装载失败啊!!common.a_hex(key1, key2, 12);
是什么??
[解决办法]
装载密码是rf_load_key,装载后才能authcation校对, comomn.a_hex Ascii 转 16进制,

修改密码有人解决了吗? 调用 rf_changeb3 返回值总是为1
[解决办法]
因为你的控制指令没写对,应该是0xff, 0x7, 0x80, 0x69
[解决办法]

引用:
装载密码是rf_load_key,装载后才能authcation校对, comomn.a_hex Ascii 转 16进制,

修改密码有人解决了吗? 调用 rf_changeb3 返回值总是为1

看来我们一起做IC卡开发嘛。。
我今天才解决的。。修改密码还是要先调用
rf_card
rf_authurtication...
然后才能修改。。

热点排行