示例#1
0
        private void tsmiSend_Click(object sender, EventArgs e)
        {
            var selectedItems = lvClients.SelectedItems;

            if (selectedItems.Count > 0)
            {
                string datagram = Microsoft.VisualBasic.Interaction.InputBox("please input something", "SendToTcpClient", string.Empty, -1, -1);
                for (int i = 0; i < selectedItems.Count; i++)
                {
                    string ip = selectedItems[i].SubItems[1].Text + ":" + selectedItems[i].SubItems[2].Text;
                    aas.SendToSelectedClient(ip, datagram);
                }
            }
        }
示例#2
0
        private void tsmiSend_Click(object sender, EventArgs e)
        {
            var selectedItems = lvClients.SelectedItems;

            if (selectedItems.Count > 0)
            {
                string datagram = Microsoft.VisualBasic.Interaction.InputBox("please input something", "SendToTcpClient", string.Empty, -1, -1);
                byte[] sendData;
                if (rbtnH16.Checked == true)
                {
                    sendData = StaticMethod.StringToByteArray(datagram);
                }
                else
                {
                    sendData = Encoding.ASCII.GetBytes(datagram);
                }
                for (int i = 0; i < selectedItems.Count; i++)
                {
                    string ip = selectedItems[i].SubItems[1].Text + ":" + selectedItems[i].SubItems[2].Text;
                    aas.SendToSelectedClient(ip, sendData);
                }
            }
        }