繁体   English   中英

使用DDE获取网页的来源

[英]Using DDE to get the source of a webpage

好。 我知道我可以使用DDE来获取网页的URL,甚至可以在外部Web浏览器(例如Firefox)中打开特定页面。 我想知道获取显示的网页来源将需要什么。 如果有人可以提供帮助,我将不胜感激。 我正在使用vb.net,但是我可以轻松地获取任何可用的C#示例。 我已经用谷歌搜索,似乎找不到很多。

粗糙且准备就绪,但是:

using System;

namespace So2
{
    class Program
    {
        public static void Main(string[] args)
        {

            System.Net.WebRequest req = System.Net.WebRequest.Create("http://www.google.com");

            System.Net.WebResponse response = req.GetResponse();

            string source = new System.IO.StreamReader(response.GetResponseStream()).ReadToEnd();

            Console.WriteLine(source);

            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM