Hello Ravi
at the beginning many thanx about your code segment really it helped my so much, but after I write it down with some modifications ,It just open the login page which I pass to it with out doing any login , the code I have done is as the following:
string LOGIN_URL = "http://www.facebook.com/index.php";
string USERNAME = "myaccount@yahoo.com";
string PASSWORD = "mypassword";
HttpWebRequest webRequest = WebRequest.Create(LOGIN_URL) as HttpWebRequest;
StreamReader responseReader = new StreamReader(
webRequest.GetResponse().GetResponseStream()
);
string responseData = responseReader.ReadToEnd();
responseReader.Close();
string postData = "email=mostafa_h_wahab@yahoo.com;pass=ekramhamdy";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
CookieContainer cookies = new CookieContainer();
webRequest = WebRequest.Create(LOGIN_URL) as HttpWebRequest;
webRequest.Method = "POST";
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.CookieContainer = cookies;
StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream());
requestWriter.Write(postData);
requestWriter.Close();
webRequest.GetResponse().Close();
SECRET_PAGE_URL = "http://www.facebook.com/#!/profile.php?id=100001740129596";
webRequest = WebRequest.Create(SECRET_PAGE_URL) as HttpWebRequest;
webRequest.CookieContainer = cookies;
responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());
responseData = responseReader.ReadToEnd();
responseReader.Close();
Response.Write(responseData);
please if you get why this code stop at the login page and dont do on on the loging process please send me or tell me about some url may help me in completing that
thanx again
best regards
Mostafa