Home > Net >  Familiar with c # Microsoft. Web. IIS administrator development came in to look at.
Familiar with c # Microsoft. Web. IIS administrator development came in to look at.

Time:10-02

I use the servermanager IIS sites listed, when no FTP site, the site with the following list all site in IIS normal
The ServerManager IISManager=new the ServerManager ();
Enclosing listBox1. Items. The Clear ();
String StateStr="";
for (int i=0; I & lt; IISManager. Sites. Count; I++)
{

The switch (IISManager Sites [I] State)
{
Case ObjectState. Started:
{
StateStr="ID:" + IISManager. Sites [I] ID + "normal"; break;
}
Case ObjectState. Starting:
{
StateStr="ID:" + IISManager. Sites [I] ID + "starting"; break;
}
Case ObjectState. Stopping:
{
StateStr="ID:" + IISManager. Sites [I] ID + "is to stop"; break;
}
Case ObjectState. Stopped:
{
StateStr="ID:" + IISManager. Sites [I] ID + "stop"; break;
}
}
Enclosing listBox1. Items. The Add (IISManager Sites [I] Name + "/" + StateStr + "");
}
But when you have a FTP site in IIS, the above code will be an error, an error is as follows:

  •  Tags:  
  • C#
  • Related