I try to retrieve session information for IIS FTP using C #, Windows 2008 and IIS 7.5 I am here. I have login information like users etc.
Try it:
Using the system; Microsoft.Web. Using Administration; Sample of stable static class {Private Static Zero (Main) (Manager = New Server Manager (Server) using Server Manager Server) {configuration config = serverManager.GetApplicationHostConfiguration (); Configuration sites sites = config.GetSection ("system.applicationHost / sites"); ConfigurationAlternativeCollectionSitesSeclectation = SitesActionGetCollection (); Configuration Element Site Element = Search Element (Selection of Sites, "Site", "Name", "YOURSITENAMEHERE"); If (Site Element == free) throw a new invalid operation exception ("element not found!"); Configuration Element ftpServerElement = siteElement.GetChildElement ("ftpServer"); ConfigurationAllmentCollectionSessionExp = php serverAllimate.GetChildAllement ("session"). GetCollection (); Console.light line (string.format ("active session: {0}", session_count.cc)); Foregoing (Element in Configuration Element session authentication) {Console.WriteLine (string.format ("\ session ID: {0}", session element. Attribute ["sessionId"]. Value.ToString ()); Console.witline (string.format ("\ t \ tusername: {0}", session element.feed ["user name"]. Value.ToString ())); Console.light line (string.format ("\ t \ t previous command: {0}", sessionAmlement.Attivision ["previous command"]. Value.ToString ()); }}}} Private Static Configuration Element Search Element (Configuration Element Collection Collection, String ElementTagname, Parameter String [] Key Value) {foreach (in the Configuration Element Element Collection) {if (string.qualz (element.elemantnamename, element tagname, string compiler Ordinal Ignore Seas)) {Bull matches = true; For (int i = 0; i
HH, memphis
context:
Comments
Post a Comment