[英]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.