Exemple #1
0
        private void btnSendText_Click(object sender, EventArgs e)
        {
            int ret    = 0;
            int icolor = 3000;

            m_nWidth  = Convert.ToInt32(m_edtWidth.Text);
            m_nHeight = Convert.ToInt32(m_edtHeight.Text);
            IntPtr iPtr = Marshal.StringToHGlobalAnsi(m_edtText.Text);

            if (1 == InitComm())
            {
                if (0 == m_nCommType)
                {
                    ret = CP5200.CP5200_RS232_SendText(m_nCardID, 0, iPtr, icolor, 16, 3, 0, 3, 0);
                }
                else
                {
                    ret = CP5200.CP5200_Net_SendTagText(m_nCardID, 0, iPtr, icolor, 16, 3, 0, 3, 0);
                }

                if (0 <= ret)
                {
                    MessageBox.Show("Successful");
                }
                else
                {
                    MessageBox.Show("Fail");
                }
            }
        }