public static void ListOpen()
 {
     AnswersCollection.HX_EnableWhitelist(1);
 }
        public void Message()
        {
            //AnswersCollection.CallbackDelegate DeleFun = new AnswersCollection.CallbackDelegate(CallbackFun);

            if (!Global.g_haslessonOff)
            {
                AnswersCollection.HX_StopRegister();
                ///AnswersCollection.HX_RemovefromWhitelist("");   //只有点下课,才能解绑
                AnswersCollection.HX_CloseDevice();
                //AnswersCollection.HX_Release();
                Global.g_haslessonOff = false;    //点上课,初始化一次
            }


            if (acallback == null)
            {
                acallback = new AnswersCollection.CallbackDelegate(CallbackFun);
            }

            int ret1 = AnswersCollection.HX_Init();

            StringBuilder sComs     = new StringBuilder(256);
            int           DeviceCnt = AnswersCollection.HX_EnumDevices(sComs);

            if (DeviceCnt <= 0)
            {
                return;
            }

            string[]   Devices      = sComs.ToString().Split(';');
            List <int> list_devices = new List <int>();

            foreach (string s in Devices)
            {
                if (s.Trim() == string.Empty)
                {
                    continue;
                }
                device = AnswersCollection.HX_OpenDevice(s.ToString());
            }

            AnswersCollection.HX_SetCallbackAddr(acallback);

            AnswersCollection.HX_UpdateTime();
            //AnswersCollection.HX_UnlockRegister("");
            // AnswersCollection.HX_RemovefromWhitelist(null);


            //AnswersCollection.HX_AddtoWhitelist("0854936875;1049486165");


            AnswersCollection.HX_EnableWhitelist(1);


            //AnswersCollection.HX_StopRegister();
            AnswersCollection.HX_StartRegister();


            //int rrt = AnswersCollection.HX_SetWorkMode(TBModeDef.HX_MODE_SINGLE, "");
            //int ret = AnswersCollection.HX_Start();

            ////int Reader = 0;
            ////if (AnswersCollection.HX_QueryReaderID(ref Reader) == 0)
            ////{
            ////    label1.Text = "班级:" + Reader;
            ////}
            ////else
            ////{
            ////    label1.Text = "查看接收器是否连接正常或插拔下";
            ////}
            //设置接收器ID
            AnswersCollection.HX_QueryReaderID(ref Reader);
        }
 public static void ListClose()
 {
     AnswersCollection.HX_EnableWhitelist(0);
 }