は、私は、Web応答を得るのStreamReaderとの文字列を検索し、文字列として応答を得るためには、StreamReaderを使用する効率的な方法が
私のコードがある列の
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string strResponse = reader.ReadToEnd();
サンプルがある
<div class="box-round">
<ol style="list-style-type: decimal;list-style-position:outside;margin-left:42px;">
<li>Order ID #A123456 already exists: Update performed
</ol>
</div>
か
<div class="box-round">
<ol style="list-style-type: decimal;list-style-position:outside;margin-left:42px;">
<li>New order created
</ol>
</div>
私は、文字列
Order ID #A123456 already exists: Update performed
または
New order created
以内に次の行を見つけたい、これは個人的に、私は希望、ライン(s)は
while (!reader.EndOfStream)
{
line = reader.ReadLine();
if (!string.IsNullOrEmpty(line))
{
}
}
ための交渉よりも多くありますHTMLの解析?一般的に言えば、HTMLパーサを使用する必要があります。 [HTMLアジリティパック](http://htmlagilitypack.codeplex.com/)がそれを手伝ってくれました。 –
あなたはどんなタイプの効率をお探しですか?すなわち、メモリ、CPUまたはネットワークの使用を最小限に抑えることについて懸念しているリソースはどれですか? – Andy
私はHTML Agilityを使うことができませんPAck – CapsLock