返回首页

您好,

如何配合"字符串模式="html代码?

string url = "http://nbt.tj/ru/kurs/?c=4&id=28&lg=ru&d=";

 

string pattern = "<td width="180" id="k_kurs">1 USD                    4.7543</td>";

    

Match match = Regex.Match(html, pattern);

label2.Content = match.Groups[0].ToString();

谢谢。

回答

评论会员:游客 时间:2012/02/06
Khushik:您好,谢谢你的链接非常有用的单证。{C}当我运行这个脚本,系统显示我的错误"无法识别的转义序列"。你可以写信给我正确的方法来解决它?我想,以符合下列:codepreid=spanclass="code-string""/spanspanclass="code-string"k_kurs"/span>spanclass="code-digit"1/spanUSDspanclass="code-digit"4/span.spanclass="code-digit"7554/span</td>/pre/code的
RaisKazi:使用WebClient.DownloadString下载相应的URL的HTML

看看下面的链接有更多对WebClient.DownloadString信息



这里是"正则表达式"情侣信息的链接。
{A}

{A2}
评论会员:游客 时间:2012/02/06
Khushik:字符串模式=@"(*)\出价\d\Dk_kurs\d\D1的\sUSD(\D\D\D\D\D)\d\DTD\D"的;