Click here to Skip to main content
16,017,151 members
Home / Discussions / C#
   

C#

 
GeneralRe: file close issue Pin
George_George10-Jun-08 21:35
George_George10-Jun-08 21:35 
GeneralRe: file close issue Pin
N a v a n e e t h11-Jun-08 16:15
N a v a n e e t h11-Jun-08 16:15 
GeneralRe: file close issue Pin
George_George11-Jun-08 16:18
George_George11-Jun-08 16:18 
Questionfacebook login. Pin
udikantz10-Jun-08 17:05
udikantz10-Jun-08 17:05 
AnswerRe: facebook login. Pin
leppie10-Jun-08 23:37
leppie10-Jun-08 23:37 
GeneralRe: facebook login. Pin
udikantz11-Jun-08 3:22
udikantz11-Jun-08 3:22 
AnswerRe: facebook login. Pin
Brandon Toner17-Mar-09 11:15
Brandon Toner17-Mar-09 11:15 
AnswerRe: facebook login. [modified] Pin
Member 41081678-Sep-09 23:16
Member 41081678-Sep-09 23:16 
hi this code is running fine Facebook Login

protected void Page_Load(object sender, EventArgs e)
   {
       //string strBuffer = "email=" + username + "&pass=" + Password + "&login=Login";
       string strBuffer = "email=xxxxxxxxxxx&pass=xxxxxxxxxxxxx;login=Login";

      start_post(strBuffer);
   }

   public void start_post(string strBuffer)
   {
       //Our postvars
       byte[] buffer = System.Text.Encoding.ASCII.GetBytes(strBuffer);
       //Initialisation

       HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create("https://login.facebook.com/login.php?m&next=http%3A%2F%2Fm.facebook.com%2Fhome.php");
       //Our method is post, otherwise the buffer (postvars) would be useless
       WebReq.Method = "POST";
       //We use form contentType, for the postvars.

       WebReq.ContentType = "application/x-www-form-urlencoded";
       //The length of the buffer (postvars) is used as contentlength.
       WebReq.ContentLength = buffer.Length;
       //We open a stream for writing the postvars
       WebReq.Referer = "http://www.facebook.com/index.php?";

       Stream PostData = WebReq.GetRequestStream();
       //Now we write, and afterwards, we close. Closing is always important!
       PostData.Write(buffer, 0, buffer.Length);
       PostData.Close();
       //Get the response handle, we have no true response yet!
      // HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
      // //Let's show some information about the response
      //WebResp.StatusCode;
      //WebResp.Server;

       //Now, we read the response (the string), and output it.
       using (HttpWebResponse response = (HttpWebResponse)WebReq.GetResponse())
       {
           using (StreamReader reader = new StreamReader(response.GetResponseStream()))
           {
           Response.Write(reader.ReadToEnd());

           }
       }
   }


modified on Monday, November 2, 2009 7:32 AM

QuestionHow initiate GPRS connection in WM 6 Pin
manu4ever10-Jun-08 12:12
manu4ever10-Jun-08 12:12 
QuestionCompiler options in C# Pin
Member 391904910-Jun-08 11:51
Member 391904910-Jun-08 11:51 
AnswerRe: Compiler options in C# Pin
Christian Graus10-Jun-08 11:57
protectorChristian Graus10-Jun-08 11:57 
GeneralRe: Compiler options in C# Pin
Member 391904910-Jun-08 12:05
Member 391904910-Jun-08 12:05 
GeneralRe: Compiler options in C# Pin
Christian Graus10-Jun-08 12:25
protectorChristian Graus10-Jun-08 12:25 
GeneralRe: Compiler options in C# Pin
Member 391904910-Jun-08 12:46
Member 391904910-Jun-08 12:46 
GeneralRe: Compiler options in C# Pin
Christian Graus10-Jun-08 13:04
protectorChristian Graus10-Jun-08 13:04 
GeneralRe: Compiler options in C# Pin
Judah Gabriel Himango10-Jun-08 13:24
sponsorJudah Gabriel Himango10-Jun-08 13:24 
QuestionDatatable issue Pin
NewToAspDotNet10-Jun-08 10:41
NewToAspDotNet10-Jun-08 10:41 
AnswerRe: Datatable issue Pin
Christian Graus10-Jun-08 11:09
protectorChristian Graus10-Jun-08 11:09 
Questiona security problem [modified] Pin
Sajjad Izadi10-Jun-08 10:16
Sajjad Izadi10-Jun-08 10:16 
AnswerRe: a security problem Pin
Christian Graus10-Jun-08 11:10
protectorChristian Graus10-Jun-08 11:10 
GeneralRe: a security problem Pin
Sajjad Izadi10-Jun-08 11:17
Sajjad Izadi10-Jun-08 11:17 
GeneralRe: a security problem Pin
Christian Graus10-Jun-08 11:24
protectorChristian Graus10-Jun-08 11:24 
Question[Message Deleted] Pin
Sr...Frank10-Jun-08 10:13
Sr...Frank10-Jun-08 10:13 
AnswerRe: AutoComplete Combobox!!! Pin
teejayem10-Jun-08 10:18
teejayem10-Jun-08 10:18 
QuestionHow to create a new ASPNETDB database? Pin
allende10-Jun-08 9:02
allende10-Jun-08 9:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.