码迷,mamicode.com
首页 > 其他好文 > 详细

Zebra - zebra command to get printer status

时间:2014-10-28 19:38:01      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:blog   io   ar   sp   div   on   log   bs   new   

        /// <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;
        }

 

Zebra - zebra command to get printer status

标签:blog   io   ar   sp   div   on   log   bs   new   

原文地址:http://www.cnblogs.com/JustYong/p/4057254.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!