open web links like files

Posted on 2007-07-30
Last Modified: 2013-12-17
I am developing an application In C# .NET 2.0. I need to get the Raw HTML code for some internet links/sites.

I don't want to render the HTML. I just need the raw HTML. The file stream methods/classes doesn't allow UNC paths. So, how do I do that. I don't even want to write code for HTTP protocol.
Question by:ashu01
    LVL 58

    Accepted Solution

    System.Net.WebClient wc = new System.Net.WebClient();
    wc.DownloadFile(URL, FilePathToSaveHTML);

    or use

    HTML = wc.DownloadString(URL);
    LVL 1

    Author Comment

    I is possible to use POST method for HTTP and allow the site to set a cookie...which will then be used for subsequent calls?
    LVL 58

    Expert Comment

    Use one of the overloaded methods UploadData to do the POST.

    If you also need to set cookie, then you need to use HTTPWebRequest class

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    network + 7 60
    Help needed on website authentication 7 37
    Help with uploading excel file 2 26
    Xamarin 10 20
    After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now