设网页源代码是 UrlStr一般超链接代码是<a href="......">,引号内就是你想要的。先把UrlStr中的空格去掉UrlStr=UrlStr.replace(" ","");Regex linkReg=new Regex("<ahref=\"([^\"]+)\">");MatchCollection linkCollection =linkReg.Matches(UrlStr);HashTable linkHashTable =new HashTable();//结果存于HashTable中,或是数组中Foreach(Match linkMatch in linkCollection){ if(!linkHashTable.Contains(linkMatch.Groups[1].Value.Trim())&&(linkMatch.Groups[1].Value.Trim().Contains("googleads.g.doubleclick")))//是否含有"googleads.g.doubleclick" { linkHashTable.Add(linkMatch.Groups[1].Value.Trim(),linkMatch.Groups[1].Value.Trim()); }}//全部符合条件的都在HashTable中了