![ContractedBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![ExpandedBlockStart.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
1 using System;
2
3 using System.Collections.Generic;
4
5 using System.Text;
6
7 using System.Text.RegularExpressions;
8
9 using System.IO;
10
11 using System.Net;
12
13
14
15 namespace imgtest
16
17 {
18
19 class Program
20
21 {
22
23 static void Main(string[] args)
24
25 {
26
27 string PageText = "<TABLE cellSpacing=0 cellPadding=0 width=1000 border=0> <TBODY> <TR> <TD width=859><img id=index_cut_r1_c1 height=67 alt=\"\" src=\"http://www.cneeex.com/images/index_cut_r1_c1.gif\" width=859 border=0 name=index_cut_r1_c1></TD> <TD width=63><IMG id=index_cut_r1_c16 height=67 alt=\"\" src=\"http://www.cneeex.com/images/index_cut_r1_c16.gif\" width=63 border=0 name=index_cut_r1_c16></TD> ";
28
29 PageText = PageText.Replace("\r\n", "");
30
31 MatchCollection TDMatchs = Regex.Matches(PageText, "<IMG.*?src=\"(.*?.*?)\".*?>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
32
33 for (int i = 0; i < TDMatchs.Count; i++)
34
35 {
36
37 Console.WriteLine("图片地址为:" + TDMatchs[0].Groups[1].Value);
38
39 }
40
41 Console.Read();
42
43 }
44
45 }
46
47 }
48