5
Reply

Download source code of a page with windows form

Ask a question
Hi,

i am having some problems with downloading a source code with my win form application. The problem is that when im browsing on the web page i need username and password to get my information. When i try to use this programaticly i dont know how to pass this username and password to the site.

For the sites that does not require username and password i am doing with this

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"http://hockey.powerplaymanager.com/");
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream receiveStream = response.GetResponseStream();
            StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
            StreamWriter sw =new StreamWriter("test.txt");
            while ((line=readStream.ReadLine())!=null)
            {
                sw.WriteLine(line);
            }
            sw.Close();

Can i somehowe pass username and password to the site? 

Hope you get what i want to do.

Thanks

Answers (5)