Click here to Skip to main content
15,041,025 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm wanting to login to this website


and return all the html using httpwebrequest

1   var request = WebRequest.Create("");
2   HttpWebResponse response = (HttpWebResponse)request.GetResponse();
3   StreamReader reader = new StreamReader(response.GetResponseStream());
4   string result = reader.ReadToEnd();

This re-directs to the login page as expected and returns that. I'm looking for a way to send the username and password to automatically login and go to the right page. I've already had a look of lots of similar questions and tried a few different things but can;t get anything to work. It always re-directs and can only ever get the login page back. I'm a decent c# programmer but don't really understand how the web login stuff works with PHP e.t.c. I've already spent several hours trying to figure this out so if anyone can provide me with a bit of code that will make this work will be hugely appreciated.

login details (this is a real account I've created)

username - testuser1
password - testing

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900