Created
August 1, 2012 12:45
-
-
Save ElemarJR/3226537 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void PrintLinksFromMSDNWithContinuation() | |
{ | |
var wc = new WebClient(); | |
wc.DownloadStringCompleted += wc_DownloadStringCompleted; | |
wc.DownloadStringAsync(new Uri("http://msdn.microsoft.com/pt-br/")); | |
} | |
void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) | |
{ | |
var regex = "href\\s*=\\s*(?:\"(?[^\"]*)\"|(?\\S+))"; | |
var matches = Regex.Matches(e.Result, regex); | |
foreach (Match match in matches) | |
Console.WriteLine(match.Groups[1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment