Esempio n. 1
0
        private void cmdSend_Click(object sender, EventArgs e)
        {
            var wrt = txtTelegramm.Text;

            string add = "";

            if (chkShowDate.Checked)
            {
                add += DateTime.Now.ToString();
            }
            if (chkShowRecievedLen.Checked)
            {
                if (!string.IsNullOrEmpty(add))
                {
                    add += " - ";
                }
                add += wrt.Length.ToString().PadLeft(4, '0') + " Bytes";
            }
            if (!string.IsNullOrEmpty(add))
            {
                add += ": ";
            }

            txtSended.Text = add + wrt + Environment.NewLine + txtSended.Text;
            if (tcpFunc != null)
            {
                tcpFunc.SendStringData(txtTelegramm.Text);
            }
        }
Esempio n. 2
0
        private void SendTel(string tel)
        {
            sendedTele.Add(tel);

            var wrt = tel;

            string add = "";

            if (chkShowDate.Checked)
            {
                add += DateTime.Now.ToString();
            }
            if (chkShowRecievedLen.Checked)
            {
                if (!string.IsNullOrEmpty(add))
                {
                    add += " - ";
                }
                add += wrt.Length.ToString().PadLeft(4, '0') + " Bytes";
            }
            if (!string.IsNullOrEmpty(add))
            {
                add += ": ";
            }

            txtSended.Text = add + wrt + Environment.NewLine + txtSended.Text;
            if (tcpFunc != null)
            {
                tcpFunc.SendStringData(tel);
            }
        }