Click here to Skip to main content
12,505,104 members (63,514 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET ASP.NET4
im unable to login to codeproject when i try to login using webrequest it redirects me login page again. please hava look on this site :



WebRequest request = WebRequest.Create("https://www.codeproject.com/script/Membership/LogOn.aspx");
 
            request.Method = "POST";
 
            string postData = "email='[DELETED]@gmail.com',password='[DELETED]'";
            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
 
            request.ContentType = "application/x-www-form-urlencoded";
 
            request.ContentLength = byteArray.Length;
 
            Stream dataStream = request.GetRequestStream();
 
            dataStream.Write(byteArray, 0, byteArray.Length);
 
            dataStream.Close();
 
            WebResponse response = request.GetResponse();
 
            Response.Write(((HttpWebResponse)response).StatusDescription);
 
            dataStream = response.GetResponseStream();
 
            StreamReader reader = new StreamReader(dataStream);
 
            string responseFromServer = reader.ReadToEnd();
 

            Response.Write(responseFromServer);
 
            reader.Close();
            dataStream.Close();
            response.Close();

[edit]Email and password removed - OriginalGriff[/edit]
Posted 23-Feb-13 4:17am
Updated 23-Feb-13 4:21am
v2
Comments
OriginalGriff 23-Feb-13 10:22am
   
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know.

And to post your login email and your password in a forum is just stupid! Go to "My Settings" right now, and change it, before it gets used and changed for you!
shanalikhan 23-Feb-13 12:55pm
   
oh sorry i forgot to change it , thanks
Jibesh 24-Feb-13 15:39pm
   
what are you trying to do?

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 23 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100