示例#1
0
        /// <summary>
        /// 开新线程,进行下发学生姓名,获取设备信息和硬件信息
        /// </summary>
        /// <param name="strDeviceMacObj"></param>
        public void setCmd(object strDeviceMacObj)
        {
            string strDeviceMac = strDeviceMacObj as string;

            if (!string.IsNullOrEmpty(strDeviceMac))
            {
                Thread.Sleep(200);
                rbtnet_.configBmpStu(strDeviceMac, strDeviceMac, "学生" + strDeviceMac.Substring(8, 3));
            }

            Thread.Sleep(400);
            rbtnet_.SendCmd((int)DeviceCmd.CMD_DEVICE_INFO, strDeviceMac);
            Thread.Sleep(400);
            rbtnet_.SendCmd((int)DeviceCmd.CMD_DEVICE_HARD_INFO, strDeviceMac);
        }
示例#2
0
        private void Rbtnet__deviceNameEvt_(IntPtr ctx, string strDeviceMac, string strDeviceName)
        {
            // Console.WriteLine("Rbtnet__deviceMacEvt_:{0}-{1}", strDeviceMac, strDeviceName);
            updateDeviceNameListView(strDeviceMac, strDeviceName);
            Console.WriteLine("Rbtnet__deviceMacEvt_:{0}-{1}", strDeviceMac, strDeviceName);

            Thread.Sleep(400);
            rbtnet_.configBmpStu(strDeviceMac, strDeviceMac, "学生" + strDeviceMac.Substring(8, 3));

            Thread.Sleep(400);
            rbtnet_.SendCmd((int)DeviceCmd.CMD_DEVICE_INFO);
            Thread.Sleep(400);
            rbtnet_.SendCmd((int)DeviceCmd.CMD_DEVICE_HARD_INFO);
        }
示例#3
0
        private void button4_Click(object sender, EventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Multiselect = false;
            fileDialog.Title       = "请选择文件";
            fileDialog.Filter      = "CSV文件|*.csv";
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                string     filePath          = fileDialog.FileName;
                FileHelper fh                = new FileHelper();
                List <DeviceSettingInfo> dic = fh.FileReadForDeviceInfo(filePath);

                foreach (var item in dic)
                {
                    rbtnet_.configBmpStu(item.DeviceNum, item.StudentNum, item.StudentName);
                    updateListStuName(item.DeviceNum, item.StudentName);
                }
            }
        }