Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interfacing with IIS 6.0 1

Status
Not open for further replies.

EzehM

Programmer
Feb 27, 2003
86
0
0
GB
Is there anyway I could programmatically interface with IIS 6.0 (using C#)?



I will like to know at any given time, the number of connected users logged on to my FTP server. At the moment, I manually have to open up IIS, get properties on the FTP Site, and see the number of users via the current sessions button. I would like to write an application that automates this process.

Thanks
 
You can tap into the FTP Service/Current Connections performance counter using the System.Diagnostics namespace.

Code:
using System.Diagnostics;

//...

PerformanceCounter counter = new PerformanceCounter();
counter.MachineName = "MACHINE";
counter.CategoryName = "FTP Service";
counter.CounterName = "Current Connections";
counter.InstanceName = "_Total";
textBox1.Text = counter.NextValue().ToString();
 
By the way did you check out the Performance tool (found Administrative Tools) it may already do what you want with no programming.
 
Thank you very much, I will try out this code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top