hello, i want to show the client's ip and machine name in ListView. Please help.
i also created code the collection for the listview collection
the code below will only show the number that the client connected to the server.
Please help, thanks a lot.
i also created code the collection for the listview collection
Code:
class ClientCollection { public string userIpadd { get; set; } public string userPcname { get; set; } public ClientCollection() { } }
Code:
// Update the list of clients that is displayed void UpdateClientList() { listView1.Items.Clear(); for(int i = 0; i < m_workerSocketList.Count; i++) { string clientKey = Convert.ToString(i+1); Socket workerSocket = (Socket)m_workerSocketList[i]; ListViewItem item = new ListViewItem(); if(workerSocket != null) { if(workerSocket.Connected) { listView1.Items.Add(clientKey); } } } }