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