C# 使用webbrowser的url的内容

C# 使用webbrowser的url的内容,c#,C#,我正在尝试使用C#中的web浏览器提取url的内容。 但内容等于“” 导航功能不会阻止执行。您需要注册该活动,然后才能获取其中的内容。这不是您使用的方式。首先,你应该知道你必须使用 现在您可以尝试以下代码: WebClient client = new WebClient(); string content = client.DownloadString("https://stackoverflow.com/search?q=web+browser+c%23"); We

我正在尝试使用C#中的web浏览器提取url的内容。 但内容等于“”


导航
功能不会阻止执行。您需要注册该活动,然后才能获取其中的内容。

这不是您使用的方式。首先,你应该知道你必须使用

现在您可以尝试以下代码:

    WebClient client = new WebClient();
    string content = client.DownloadString("https://stackoverflow.com/search?q=web+browser+c%23");
    WebClient client = new WebClient();
    string content = client.DownloadString("https://stackoverflow.com/search?q=web+browser+c%23");