我正在一個asp.net網站上工作。我需要使用c#替換HTML中的特定字符串。以下是html。 在這裏,我需要用一個有效的名稱替換「@name」使用C#代碼。 我嘗試使用Java腳本。它的工作。我可以如何實現這一點使用C#?使用c的HTML解析#
如何獲取當前頁面的HTML使用c#或HtmlAgilityPack爲了解析它?
HTML:
<div>
In the @name, you may have configured an iPad in both the AppleDevices and the TabletDevices configuration. However, because AppleDevices may have been set for a small display size, you want an iPad to use the TableDevices configuration (which has a larger screen). Reorder the devices in the following order so that an iPad will use the TableDevices configuration first.
Tablet Devices
Apple Devices
</div>
「我怎麼能得到當前頁面的HTML」你還沒有告訴我們,如果你使用WebForms,MVC,NancyFX ... – 2012-07-12 14:23:09