コード例 #1
0
        public static RuntimeTable <DownloadImage> DownloadImage(IRuntime runtime, string url, int line)
        {
            var table = new RuntimeTable <DownloadImage>();

            var image = GetImage(runtime.RequestFactory, new WebRequestHttpWire(url, runtime, line));

            table.Add(image);
            return(table);
        }
コード例 #2
0
        private static RuntimeTable <DownloadPage> DownloadPage(IRuntime runtime, IHttpWire[] wires)
        {
            var table = new RuntimeTable <DownloadPage>();

            foreach (var wire in wires)
            {
                int contentlength;
                var doc = GetDocument(runtime.RequestFactory, wire, out contentlength);
                table.Add(new DownloadPage()
                {
                    url = wire.Url, nodes = DownloadedNodes.FromHtmlDoc(doc), date = DateTime.Now, size = contentlength
                });
            }

            return(table);
        }
コード例 #3
0
ファイル: Http.cs プロジェクト: xtmhm2000/pickaxe
        private static RuntimeTable <DownloadPage> DownloadPage(IRuntime runtime, string[] urls)
        {
            var table = new RuntimeTable <DownloadPage>();

            foreach (var url in urls)
            {
                int contentlength;
                var doc = GetDocument(runtime.RequestFactory, url, out contentlength);
                table.Add(new DownloadPage()
                {
                    url = url, nodes = new[] { doc.DocumentNode }, date = DateTime.Now, size = contentlength
                });
            }

            return(table);
        }