Click here to Skip to main content
11,573,862 members (56,011 online)
   

C#

 
GeneralRe: What kind of video recognition software exists? Pin
Wigwam23236-May-13 8:49
memberWigwam23236-May-13 8:49 
GeneralRe: What kind of video recognition software exists? Pin
Pete O'Hanlon6-May-13 9:04
protectorPete O'Hanlon6-May-13 9:04 
GeneralRe: What kind of video recognition software exists? Pin
Dave Kreskowiak6-May-13 12:02
mvpDave Kreskowiak6-May-13 12:02 
QuestionRemplir une datagridview à l'aide d'une autre Pin
geralson6-May-13 4:45
membergeralson6-May-13 4:45 
AnswerRe: Remplir une datagridview à l'aide d'une autre Pin
Eddy Vluggen6-May-13 4:58
mvpEddy Vluggen6-May-13 4:58 
GeneralFill a datagridview using another Pin
geralson6-May-13 5:09
membergeralson6-May-13 5:09 
GeneralRe: Fill a datagridview using another Pin
Dave Kreskowiak6-May-13 7:12
mvpDave Kreskowiak6-May-13 7:12 
QuestionFetch Data from another website Pin
sandeep Nishad5-May-13 20:40
membersandeep Nishad5-May-13 20:40 
AnswerRe: Fetch Data from another website Pin
OriginalGriff5-May-13 22:07
mvpOriginalGriff5-May-13 22:07 
AnswerRe: Fetch Data from another website Pin
Clifford Nelson6-May-13 5:38
memberClifford Nelson6-May-13 5:38 
QuestionAuto Dial-Up Method not working on 64-bit machine Pin
Member 100161425-May-13 14:40
professionalMember 100161425-May-13 14:40 
AnswerRe: Auto Dial-Up Method not working on 64-bit machine Pin
Garth J Lancaster5-May-13 16:41
memberGarth J Lancaster5-May-13 16:41 
GeneralRe: Auto Dial-Up Method not working on 64-bit machine Pin
Member 100161428-May-13 20:10
professionalMember 100161428-May-13 20:10 
Questionwebrequest/response live.mail.com Pin
Crispybc5-May-13 12:15
memberCrispybc5-May-13 12:15 
Hi I have just started a little app to learn about web requests. Basically all I want to do is to login to hotmail via console and return the mail page. here is my code:
using System;
using System.Data;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Web;
using System.Text;
 

 
namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
 
            var request = (HttpWebRequest)WebRequest.Create("http://login.live.com/");
            
 
            String email = "test@hotmail.com";
            String password = "password";
            String postString = "login=" + email + "&passwd=" + password;
            CookieCollection cookies = new CookieCollection();
 
            string url = "http://login.live.com/";
            // Set the request parameters
            request = WebRequest.Create(url) as HttpWebRequest;
            request.Method = "GET";
            request.Referer = url;
            request.KeepAlive = true;
            request.UserAgent = "User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0";
            request.ContentType = "application/x-www-form-urlencoded";
            request.CookieContainer = new CookieContainer();
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            cookies = response.Cookies;
            
    
           
            // Convert the submit string data into the byte array
            Byte[] postData = Encoding.ASCII.GetBytes(postString);
            url = "http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1193552878&rver=4.5.2130.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fdefault.aspx&id=64855";
            // Set the request parameters
            request = WebRequest.Create(url) as HttpWebRequest;
            request.AllowAutoRedirect = true;
            request.Method = "POST";
            request.Referer = url;
            request.KeepAlive = true;
            request.UserAgent = "User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0";
            request.ContentType = "application/x-www-form-urlencoded";
            request.CookieContainer = new CookieContainer();
            request.CookieContainer.Add(cookies);
            request.ContentLength = postData.Length;
 
            // Submit the request data
            System.IO.Stream outputStream = request.GetRequestStream();
            request.AllowAutoRedirect = true;
            outputStream.Write(postData, 0, postData.Length);
            outputStream.Close();
 

            // Get the return data
            
            Console.WriteLine(response.StatusCode);
            Console.WriteLine(response.StatusDescription);
            Console.WriteLine(response.Server);
            Stream dataStream = response.GetResponseStream();
            StreamReader reader = new System.IO.StreamReader(dataStream);
            String responseFromServer = reader.ReadToEnd();
            StreamWriter sw = new StreamWriter("test.html");
            sw.Write(responseFromServer);
            Console.Write(responseFromServer);
            Console.ReadLine();
 

 

 

 

        }
    }
}

Problem is I keep getting this returned.
<html dir="ltr" lang="EN-US"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=Edge"/><base href="http://login.live.com/pp1450/"/><script type="text/javascript">var PROOF = {};PROOF.Type = {SQSA: 6, CSS: 5, DeviceId: 4, Email: 1, AltEmail: 2, SMS: 3, HIP: 8, Birthday: 9, TOTPAuthenticator: 10, Voice: -3};</script><noscript><meta http-equiv="Refresh" content="0; URL=http://login.live.com/jsDisabled.srf?mkt=EN-US&lc=1033"/>Microsoft account requires JavaScript to sign in. This web browser either does not support JavaScript, or scripts are being blocked.<br /><br />To find out whether your browser supports JavaScript, or to allow scripts, see the browser's online help.</noscript><title>Sign in to your Microsoft account</title><meta name="PageID" content="i5030"/><meta name="SiteID" content="10"/><meta name="ReqLC" content="1033"/><meta name="LocLC" content="1033"/><link rel="shortcut icon" href="http://auth.gfx.ms/14.500.21648.00/favicon.ico?v=2" />

Anyone able to provide some insight?
Thanks.
AnswerRe: webrequest/response live.mail.com Pin
Bernhard Hiller5-May-13 22:04
professionalBernhard Hiller5-May-13 22:04 
GeneralRe: webrequest/response live.mail.com Pin
Crispybc6-May-13 2:41
memberCrispybc6-May-13 2:41 
Questionproblem Webservice Pin
azadehrasadi5-May-13 0:12
memberazadehrasadi5-May-13 0:12 
AnswerRe: problem Webservice Pin
OriginalGriff5-May-13 6:08
mvpOriginalGriff5-May-13 6:08 
GeneralRe: problem Webservice Pin
azadehrasadi12-May-13 2:17
memberazadehrasadi12-May-13 2:17 
GeneralRe: problem Webservice Pin
OriginalGriff12-May-13 2:24
protectorOriginalGriff12-May-13 2:24 
GeneralRe: problem Webservice Pin
azadehrasadi12-May-13 18:31
memberazadehrasadi12-May-13 18:31 
QuestionWEB SERVICES Pin
sonu Ranjan4-May-13 22:16
membersonu Ranjan4-May-13 22:16 
AnswerRe: WEB SERVICES Pin
Abhinav S5-May-13 20:37
mvpAbhinav S5-May-13 20:37 
QuestionUSB device being in use Pin
Blubbo3-May-13 5:10
memberBlubbo3-May-13 5:10 
AnswerRe: USB device being in use Pin
Gerry Schmitz3-May-13 11:54
memberGerry Schmitz3-May-13 11:54 
GeneralRe: USB device being in use Pin
Blubbo8-May-13 8:23
memberBlubbo8-May-13 8:23 
GeneralRe: USB device being in use Pin
Gerry Schmitz8-May-13 11:12
memberGerry Schmitz8-May-13 11:12 
QuestionIs streamreader slow compared to other text import functions? Pin
turbosupramk33-May-13 3:42
memberturbosupramk33-May-13 3:42 
AnswerRe: Is streamreader slow compared to other text import functions? Pin
GuyThiebaut3-May-13 4:21
memberGuyThiebaut3-May-13 4:21 
GeneralRe: Is streamreader slow compared to other text import functions? Pin
turbosupramk33-May-13 4:51
memberturbosupramk33-May-13 4:51 
AnswerRe: Is streamreader slow compared to other text import functions? Pin
Pete O'Hanlon3-May-13 4:24
protectorPete O'Hanlon3-May-13 4:24 
GeneralRe: Is streamreader slow compared to other text import functions? Pin
turbosupramk33-May-13 5:13
memberturbosupramk33-May-13 5:13 
AnswerRe: Is streamreader slow compared to other text import functions? Pin
turbosupramk33-May-13 5:14
memberturbosupramk33-May-13 5:14 
GeneralRe: Is streamreader slow compared to other text import functions? Pin
DaveyM693-May-13 13:47
mentorDaveyM693-May-13 13:47 
QuestionEvent/Delegate for progress bar issue Pin
MichCl3-May-13 3:13
memberMichCl3-May-13 3:13 
AnswerRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen3-May-13 7:21
mvpEddy Vluggen3-May-13 7:21 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 7:31
memberMichCl3-May-13 7:31 
AnswerRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen3-May-13 8:29
mvpEddy Vluggen3-May-13 8:29 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 8:39
memberMichCl3-May-13 8:39 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen3-May-13 8:53
mvpEddy Vluggen3-May-13 8:53 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 9:22
memberMichCl3-May-13 9:22 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 9:25
memberMichCl3-May-13 9:25 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen3-May-13 9:40
mvpEddy Vluggen3-May-13 9:40 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 9:48
memberMichCl3-May-13 9:48 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen4-May-13 0:41
mvpEddy Vluggen4-May-13 0:41 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl6-May-13 3:40
memberMichCl6-May-13 3:40 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen6-May-13 7:52
mvpEddy Vluggen6-May-13 7:52 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl6-May-13 9:19
memberMichCl6-May-13 9:19 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl7-May-13 2:09
memberMichCl7-May-13 2:09 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen7-May-13 3:16
mvpEddy Vluggen7-May-13 3:16 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | Last Updated 2 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid