예제 #1
0
 public bool cmd_bggSend(TCPClientChannelargsUserToken socketc, out byte[] sendbytes, out byte[] receivebytes)
 {
     sendbytes    = null;
     receivebytes = null;
     try
     {
         sendbytes = getcmdbg(2);
         server.ONLYSendToMoxa(socketc, sendbytes);
         return(true);
     }
     catch (Exception ex)
     {
         //OnMessage(MessageTypeOptions.SystemException, ("地址:" + address + "表位,屏幕被光关失败!" + ex.Message));
     }
     return(false);
 }
예제 #2
0
        public bool cmd_showSend(TCPClientChannelargsUserToken socketc, string strdata, out byte[] sendbytes1, out byte[] receivebytes1, out byte[] sendbytes2, out byte[] receivebytes2)
        {
            sendbytes1    = null;
            receivebytes1 = null;
            sendbytes2    = null;
            receivebytes2 = null;
            try
            {
                Encoding gb2312 = Encoding.GetEncoding("gb2312");
                byte[]   datas;
                byte[]   datas1 = gb2312.GetBytes("   ");
                byte[]   datas2 = gb2312.GetBytes("   ");

                datas = gb2312.GetBytes(strdata);

                for (int i = 0; i < datas.Length; i++)
                {
                    if (i < datas1.Length)
                    {
                        datas1[i] = datas[i];
                    }
                    else if (i < (datas1.Length + datas2.Length))
                    {
                        datas2[i - datas1.Length] = datas[i];
                    }
                    else
                    {
                        break;
                    }
                }
                sendbytes1 = getcmdshow1(datas1);
                server.ONLYSendToMoxa(socketc, sendbytes1);
                Thread.Sleep(500);
                sendbytes2 = getcmdshow2(datas2);
                server.ONLYSendToMoxa(socketc, sendbytes2);
                return(true);
            }
            catch (Exception ex)
            {
                //OnMessage(MessageTypeOptions.SystemException, ("地址:" + address + "表位,屏幕输入设置失败!" + ex.Message));
            }
            return(false);
        }