locked
Download HTM File

    Question

  • Hello. This is a NOOB question but how can you download an HTML file from an internet website using C#. All the codes I tried by reading the forums haven't seemed to help.
    Monday, March 20, 2006 2:04 AM

Answers

  • hi,

    you can retrieve the rss feeds you will find it at bottom of the forum at right side xml button

    anyway to read the webpage contents you can try this


    private void button1_Click(object sender, EventArgs e)
    {
    //client to read from server

    WebClient client = new WebClient();
    //client open stream to read

    Stream strm = client.OpenRead("http://www.google.com");
    StreamReader sr = new StreamReader(strm);
    string line;
    while ((line = sr.ReadLine()) != null)
    {
    textBox1.Text += line;
    Application.DoEvents();
    }
    strm.Close();
    sr.Close();
    }


     

    hope this helps

    Monday, March 20, 2006 3:27 AM