hello, i want to show the client's ip and machine name in ListView. Please help, Thank you.
i also created code the collection for the listview collection
class ClientCollection
{
public string userIpadd { get; set; }
public string userPcname { get; set; }
public ClientCollection()
{
}
}
the code below will only show the number that the client connected to the server.
// 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);
}
}
}
}