static extern void  TxNewline();//输出回车、 换行, 就是向打印机发送 0x0D,0x0A 的数据, 打印机接收到后, 会将缓冲区中的数据打印并走纸 1 行

        #endregion
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            mainPage mainPage = new mainPage();

            frameMain.Navigate(mainPage);
            mainPage.imgIdentity.MouseDown += new MouseButtonEventHandler(ImgIdentity_MouseDown);
            mainPage.imgTicket.MouseDown   += new MouseButtonEventHandler(ImgTicket_MouseDown);
            ShowTime();                                          //在这里窗体加载的时候不执行文本框赋值,窗体上不会及时的把时间显示出来,而是等待了片刻才显示了出来
            ShowTimer          = new DispatcherTimer();
            ShowTimer.Tick    += new EventHandler(ShowCurTimer); //起个Timer一直获取当前时间
            ShowTimer.Interval = new TimeSpan(0, 0, 0, 1, 0);
            ShowTimer.Start();
        }
        /// <summary>
        /// 首页返回
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Back_MouseDown(object sender, MouseButtonEventArgs e)
        {
            mainPage mainPage = new mainPage();

            frameMain.Navigate(mainPage);
            mainPage.imgIdentity.MouseDown += new MouseButtonEventHandler(ImgIdentity_MouseDown);
            mainPage.imgTicket.MouseDown   += new MouseButtonEventHandler(ImgTicket_MouseDown);
            this.topTitle.Content           = "席位置换自助终端";
            this.back.Visibility            = Visibility.Hidden;
            if (tIdentity != null)
            {
                tIdentity.Stop();
                tIdentity.Close();
            }
            if (tTicket != null)
            {
                tTicket.Stop();
                tTicket.Close();
            }
        }