/// <summary>
        /// determine whether the network printer is in pause.
        /// </summary>
        /// <param name="ip"></param>
        /// <param name="port"></param>
        /// <param name="strOutMsg"></param>
        /// <returns></returns>
        private bool IsPause(string ip, int port)
        {
            string strOutMsg = null;
            string zebraCommand = "^XA~HS^XZ";
            PrinterCommunicate printerCommunicate = new PrinterCommunicate();
            if (printerCommunicate.SendZPL_ViaNetwork(ip, port, zebraCommand, out strOutMsg))
            {
                //split retMsg with "\r\n"
                string[] retMsgs = strOutMsg.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
                if (retMsgs != null)
                {
                   string retFirstMsgItem = retMsgs[0];
                   string[] retFirstMsgItems = retFirstMsgItem.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                   return "1".Equals(retFirstMsgItems[2]);
                }
            }
            return false;
        }

 

posted on 2014-10-28 16:49  JustYong  阅读(467)  评论(0编辑  收藏  举报