下载问题

changfutao1989 2012-09-23 11:18:19
WebClient wc = new WebClient();
string content = wc.DownloadString("http://xiangce.baidu.com/index.html");
char[] chars = content.ToCharArray();
byte[] buffer = Encoding.GetEncoding("gb2312").GetBytes(chars);
content = Encoding.UTF8.GetString(buffer);
//Console.WriteLine(content);
MatchCollection matches = Regex.Matches(content, @"src:""(?<URL>http://.+/\w+\.jpg)""
");

Console.WriteLine("yes1");
foreach (Match match in matches)
{
Console.WriteLine("yes2");
if (match.Success)
{
Console.WriteLine("yes3");
Console.WriteLine(match.Groups[1].Value);
}

}

Console.WriteLine("yes4");
Console.Read();

为什么不显示图片的url
希望解释详细一点谢谢
...全文
96 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

109,901

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧