in

Agramont.net

VP of Mural Consulting...SaaS Strategy & Execution. Accelerated.

Provware

July 2006 - Posts

  • How To: View Application Pool Identity for an IIS Website

    This example will show you how to create a new website using the Provware Framework (Build 001).

    1. Create a reference pointing to the Provware.Framework.dll assembly.
    2. Add a directive to use the "Provware.Framework.Web" namespace

      using Provware.Framework.Web;

    3. Add the following code to your C# application


                WebManager wm = new WebManager();
                // Connect to Server
                WebServer ws = wm.Connect("localhost");
               
                // Bind to site by SiteName (Provwware Terminology)/ServerComment
                Site defaultWeb = ws.Sites["Default Website"];

                // Get the Application Pool ID
                string defaultWebPool = defaultWeb.IIsWebServer.AppPoolId;

                // Bind to the Application Pool Object.
                ApplicationPool pool = ws.ApplicationPools[defaultWebPool];

                Console.WriteLine(pool.IIsApplicationPool.WAMUserName);

  • How To: Create a new Website

    This example will show you how to create a new website using the Provware Framework (Build 001).

    1. Create a reference pointing to the Provware.Framework.dll assembly.
    2. Add a directive to use the "Provware.Framework.Web" namespace

      using Provware.Framework.Web;

    3. Add the following code to your C# application

    WebManager wm = new WebManager();

    WebServer iisServer = wm.Connect("localhost");

    Site newSite = iisServer.CreateSite("My Site", ":80:www.mySite.com", "C:\\Sites\\mySite\\Content\\Web", true);

    At this point, the site is now created.  The "Site" object is part of the Provware Framework.  You can now use that object to interact with the site.

Copyright Agramont.net, 2006. all rights reserved