Represents a document that needs linked files to be rendered, such as images or css files, and points to other HTML documents.
Пример #1
0
		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]);
			}
		}
Пример #2
0
        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]);
            }
        }