[Release] Server status in C# ASP.NET

Results 1 to 1 of 1
  1. #1
    if(!caffeine) continue; leorond is offline
    MemberRank
    Jul 2012 Join Date
    Czech RepublicLocation
    489Posts

    idea [Release] Server status in C# ASP.NET

    Hi, I decided to add a feature you verify the continuity port.

    It is a function that works 100%.

    PHP Code:
    public bool PortInUse(int port)
        {
            
    bool inUse false;

            
    IPGlobalProperties ipProperties IPGlobalProperties.GetIPGlobalProperties();
            
    IPEndPoint[] ipEndPoints ipProperties.GetActiveTcpListeners();


            foreach (
    IPEndPoint endPoint in ipEndPoints)
            {
                if (
    endPoint.Port == port)
                {
                    
    inUse true;
                    break;
                }
            }


            return 
    inUse;
        } 
    You can edit the function for Timer and call in your Master.Page_Load or call the function directly.

    The function has a true or false return value.




Advertisement