【问题标题】:how to get start a iis website and get performance of that web site using [closed]如何启动 iis 网站并使用 [关闭] 获得该网站的性能
【发布时间】:2014-10-28 01:05:50
【问题描述】:

最近,当我尝试使用以下代码启动网站时,它返回 null 我已经使用 severmanager 对象获取了所有网站我正在获取 asp.net 网页中的所有可视化 Web 项目this one

如何解决这个问题,我可以一次从 iis 性能计数器获取所有性能数据原始值吗?

ServerManager IIS = new ServerManager();
        List<string> iissites = new List<string>();

        foreach (Site site in IIS.Sites)
        {
            iissites.Add(site.Name.ToString());
        }
        foreach (Site site in IIS.Sites)
        {
            //Console.WriteLine(String.Concat
            //(
            //    site.Name, " , ",
            //    site.Id, " , ",
            //    //site.State, " , ",
            //    site.Applications["/"].VirtualDirectories[0].PhysicalPath
            //));
            Console.WriteLine(site.Name.ToString());

【问题讨论】:

    标签: c# asp.net iis


    【解决方案1】:

    感谢您的反馈,我通过在 Visual Studio 2010 中创建 Web 服务并链接解决了我的问题,我的意思是我有一个对 asp.net 项目的 Web 引用,并且我在我的 asp 中调用了该 Web 服务方法。网络应用程序。现在它工作正常! 感谢致敬 苏雷什中国

    【讨论】:

      猜你喜欢
      • 2015-01-21
      • 2014-01-29
      • 2011-11-26
      • 2018-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-23
      • 2019-01-02
      相关资源
      最近更新 更多