public string IPAddress { get; }
A string value representing the client's IP address.
This function will return the string containing the IP address of the client.
If the method fails, an error is raised. For more information, refer to the Error Codes.
using Leadtools;using Leadtools.MediaStreaming;public Server _server = null;public bool _result = false;public void PrintClientsExample(){try{int Count = 0;string strClients = "";// create an instance of the server object_server = new Leadtools.MediaStreaming.Server();// edit network propertiesNetworkProperties netProps = _server.GetNetworkProperties();string HttpUrl = "http://" + netProps.ActualIPAddress + ":" + netProps.Port + "/DaDa_H264.mp4";netProps.MediaFolder = @"C:\LEADTOOLS22\Resources\Media";_server.SetNetworkProperties(netProps);// start the server_server.Start();// make sure that there is some clients connected to the server.System.Diagnostics.Process.Start(HttpUrl);MessageBox.Show("Attempting to playback stream in default browser using: " + HttpUrl+ "\n Press OK button AFTER video starts playing");// retrieve collection of clientsClients clients = _server.GetClients();//Get the Application Properties countCount = clients.Count;// print the clients items to a stringstrClients += string.Format("--- Clients (count = {0}) ---\n\n", Count.ToString());int nIndex = 0;foreach (Client client in clients){string ip;int connections;double connectiontime;// get IP Addressip = client.IPAddress;// get number of connectionsconnections = client.Connections;// get connection timeconnectiontime = client.ConnectionTime;// convert to local timeDateTime dt = DateTime.FromOADate(connectiontime);DateTime dtLocal = dt.ToLocalTime();string sconnectiontime = dtLocal.ToString("yyyy-MM-dd HH:mm:ss");strClients += string.Format("Client[{0}]: {1}, connections = {2}, connection time = {3}\n", nIndex.ToString(), ip, connections.ToString(), sconnectiontime);nIndex++;}// display a message contains the clients information stringMessageBox.Show(strClients, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information);_result = true;}catch (Exception){_result = false;}}