Csharp Ninja

Csharp Ninja

  • NA
  • 97
  • 178.8k

I can't login to facebook with httpwebrequest

Jun 9 2012 2:11 PM
my codes here:

            string postdataman = "lsd=AVpgvQM_&[email protected]&pass=12345678&persistent=1&default_persistent=1" + "&charset_test=€,´,€,´,æ°´,Ð",Є" + "&timezone=-180&lgnrnd=104940_e5yZ&lgnjs=1339181436&locale=en_US";
            string url = "http://facebook.com";
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
            byte[] bytearray = Encoding.UTF8.GetBytes(postdataman);
            req.Method = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            req.ContentLength = bytearray.Length;
            Stream stream = req.GetRequestStream();
            stream.Write(bytearray, 0, bytearray.Length);
            WebResponse res = req.GetResponse();
            stream = res.GetResponseStream();
            StreamReader sr = new StreamReader(stream);
            string result = sr.ReadToEnd();
            textBox3.Text = result;
            if (result.Contains("blabla"))
            {
                MessageBox.Show("login successful);
            }
            stream.Close();
            res.Close();
            sr.Close();

why this code doesnt work :( it cant login to facebook. I am working on this shit for 24 hours... My eyes are hurting a lot now but still I cant solve this problem

Where is my error in my codes :( :(

Answers (1)