« Previous Next »

Answered Thread: Status of Client Connections in FTP IIS5.1

Last post 10-14-2009 5:54 AM by PuneetGupta. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 10-14-2009, 2:42 AM

    • raajesh
    • Top 500 Contributor
    • Joined on 08-06-2009, 7:25 AM
    • Posts 19

    Status of Client Connections in FTP IIS5.1

    Hi All,

      I am programatically administrating IIS5.1 server for FTP , I would like to know how can we extract the status information of the clients connected to the server such as active client connections. 

      I am using visual C# , I would like to know how this can be achieved programatically from IIS5.1? Any pointers on sample code or some code snippets on this issue will be much appreciated. 

    Thanks

     


     

  • 10-14-2009, 3:12 AM In reply to

    Answered Re: Status of Client Connections in FTP IIS5.1

    You can query the perfmonce counters for FTP from a .net application. The right counter to monitor would be Current Connections under the FTP Service object. The following code produces expected results for me.

    class Program

    {

    static void Main(string[] args)

    {

    System.Diagnostics.
    PerformanceCounter ftpCounter = new System.Diagnostics.PerformanceCounter("FTP Service",

    "Current Connections",

    "Default FTP Site",

    true);

    while (true)

    {

    System.Threading.
    Thread.Sleep(2000);Console.WriteLine("Current FTP connections = {0}",ftpCounter.NextValue());

    }

    }

    }

     

    For more information on using Perfmon counters from C# review http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecounter(VS.80).aspx

  • 10-14-2009, 3:25 AM In reply to

    • raajesh
    • Top 500 Contributor
    • Joined on 08-06-2009, 7:25 AM
    • Posts 19

    Re: Status of Client Connections in FTP IIS5.1

     Hi,

     That was a very quick solution , thanks I appriciate your kind help.

      Is there any why I can get the IP address of the clients connected to FTP server along with the counter of connections ?

    Thanks

  • 10-14-2009, 5:54 AM In reply to

    Re: Status of Client Connections in FTP IIS5.1

    There isnt an easy way or a documented way to do this. The protocol and the function details of how to do this is documented at http://msdn.microsoft.com/en-us/library/cc233834(PROT.10).aspx but calling it from .net would require some PInvoke's and a lot of research

    Not a straight away solution, though not impossilbe

Page 1 of 1 (4 items)
Microsoft Communities