文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C# 操作IIS网站应用程序池

C# 操作IIS网站应用程序池

时间:2010-09-27  来源:韩天伟

//添加应用程序池空间引用

using System.DirectoryServices;

 

 

代码    string method="Start"; //Start开启  Recycle回收  Stop 停止
   string AppPoolName = "chengxuchiname";

   try

   {    

      DirectoryEntry appPool = new DirectoryEntry("IIS://localhost/W3SVC/AppPools");

      DirectoryEntry findPool = appPool.Children.Find(AppPoolName,"IIsApplicationPool");

      findPool.Invoke(method,null);

      appPool.CommitChanges();

      appPool.Close();

    MessageBox.Show("应用程序池名称启动成功","启动成功"); 

   }

   catch(Exception ex)

   {

    MessageBox.Show(ex.Message,"启动失败");      

   }

 

 

相关阅读 更多 +
排行榜 更多 +
别惹神枪手安卓版

别惹神枪手安卓版

冒险解谜 下载
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载