static void Main(string[] args) { HtmlWeb hw = new HtmlWeb(); string url = @"http://www.microsoft.com"; HtmlDocument doc = hw.Load(url); doc.Save("mshome.htm"); DocumentWithLinks nwl = new DocumentWithLinks(doc); Console.WriteLine("Linked urls:"); for(int i=0;i<nwl.Links.Count;i++) { Console.WriteLine(nwl.Links[i]); } Console.WriteLine("Referenced urls:"); for(int i=0;i<nwl.References.Count;i++) { Console.WriteLine(nwl.References[i]); } }
static void Main(string[] args) { HtmlWeb hw = new HtmlWeb(); string url = @"http://www.microsoft.com"; HtmlDocument doc = hw.Load(url); doc.Save("mshome.htm"); DocumentWithLinks nwl = new DocumentWithLinks(doc); Console.WriteLine("Linked urls:"); for (int i = 0; i < nwl.Links.Count; i++) { Console.WriteLine(nwl.Links[i]); } Console.WriteLine("Referenced urls:"); for (int i = 0; i < nwl.References.Count; i++) { Console.WriteLine(nwl.References[i]); } }