3

我正在尝试停止 IIS 中的网站。

这是我的代码

Site oSite = SERVERMANAGER.Sites.FirstOrDefault(s => s.Name.IndexOf(websiteName) > -1);
if (oSite != null)
{
    //stop the site...
    oSite.Stop();
}

当它到达 oSite.Stop(); 它会抛出

“方法或操作未实现。”

我使用的是 Windows 7 Home Premium,我使用的 IIS 版本是 7.5。

知道如何解决这个错误吗?

4

1 回答 1

-2

你的方法可能是这样的

公共无效停止()
{

抛出新的 NotImplementedException();

}

从您的方法中删除上述行并编写方法代码

于 2015-06-29T08:23:55.660 回答