如何为HTML Agility Pack设置应用程序池 [英] How to set application pool for Html Agility Pack

查看:124
本文介绍了如何为HTML Agility Pack设置应用程序池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用htmlagilitypack将应用程序池设置为网站? 我当前正在使用应用程序池-本地系统,当我运行代码时,出现错误消息无法连接到远程服务器"

How to set application pool to a website using htmlagilitypack? I'm currently using app pool - local system, when I run my code I get an error that says "Unable to connect to the remote server"

                HtmlAgilityPack.HtmlDocument doc = hw.Load(url);
            HtmlNodeCollection nodes = doc.DocumentNode.SelectNodes("//a[@class='metatag-topi metatag-keywords']");
            HtmlNodeCollection nodes2 = doc.DocumentNode.SelectNodes("//div[@class='pagination']/a[@href]");
            HtmlNodeCollection phone = doc.DocumentNode.SelectNodes("//p[@class='phone fRight ml10']");

推荐答案

使用用户界面

  1. 打开IIS管理器.有关打开IIS管理器的信息,请参见 打开IIS管理器(IIS 7).
  2. 在连接"窗格中,展开服务器节点,然后单击确定". 应用程序池.
  3. 在应用程序池"页面上,选择用于以下目的的应用程序池: 包含您要更改的应用程序.
  4. 在操作"窗格中,单击查看应用程序".
  5. 选择要更改其应用程序池的应用程序,然后 然后在操作"窗格中单击更改应用程序池".
  6. 在选择应用程序池"对话框中,选择一个应用程序 从应用程序池"列表中选择池,然后单击确定".
  1. Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
  2. In the Connections pane, expand the server node and click Application Pools.
  3. On the Application Pools page, select the application pool that contains the application that you want to change.
  4. In the Actions pane, click View Applications.
  5. Select the application whose application pool you want to change and then click Change Application Pool in the Actions pane.
  6. In the Select Application Pool dialog box, select an application pool from the Application pool list and then click OK.

命令行

要更改运行应用程序的应用程序池,请使用以下语法:.

Command Line

To change the application pool in which an application runs, use the following syntax:.

appcmd设置应用程序/app.name:字符串/applicationPool:字符串 变量app.namestring是要更改的应用程序的名称,变量applicationPoolstring是要向其添加应用程序的应用程序池的名称.例如,在名为contoso的站点中,要将名为Deals的应用程序添加到名为Marketing的应用程序池中,请在命令提示符下键入以下内容,然后按Enter: appcmd设置应用程序/app.name: contoso/deals /applicationPool:营销 有关Appcmd.exe的详细信息,请参阅Appcmd.exe(IIS 7).

appcmd set app /app.name: string /applicationPool: string The variable app.namestring is the name of the application that you want to change, and the variable applicationPoolstring is the name of the application pool to which you want to add the application. For example, in a site named contoso, to add an application named deals to an application pool named Marketing, type the following at the command prompt, and then press ENTER: appcmd set app /app.name: contoso/deals /applicationPool: Marketing For more information about Appcmd.exe, see Appcmd.exe (IIS 7).

配置 本主题中的过程会影响以下配置元素: 下的 元素 有关IIS 7配置的详细信息,请参阅IIS 7.0:MSDN上的IIS设置架构.

Configuration The procedure in this topic affects the following configuration elements: element under For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.

使用以下WMI类,方法或属性来执行此过程: Application.ApplicationPool属性

Use the following WMI classes, methods, or properties to perform this procedure: Application.ApplicationPool property

有关WMI和IIS的更多信息,请参见 IIS 7中的Windows Management Instrumentation(WMI).有关与此过程相关的类,方法或属性的更多信息,请参见 IIS WMI提供程序MSDN网站上的参考.

For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.

配置IIS8

这篇关于如何为HTML Agility Pack设置应用程序池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆