Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > log in to microsoft live


Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2008, 11:31 PM
cyrus_xi cyrus_xi is offline
Junior Contributor
 
Join Date: May 2004
Posts: 295
Default log in to microsoft live


i want to crate a program that will display info on a live.xbox.com web site. so i need to be able to log in to microsoft live. i assume i cant do this with a regular username: password@site.com type thing. how would i do this? im just reading source code so i guess i would be using System.Net but i really havnt started anything yet. i just dont know how i would test it without being logged in.
__________________
teh upload codez!!1one HAXXORD lolz
Reply With Quote
  #2  
Old 06-20-2008, 05:31 AM
darkforcesjedi's Avatar
darkforcesjedi darkforcesjedi is offline
Trust me, I'm an

* Expert *
 
Join Date: Apr 2001
Location: In ur base, pwnin d00dz
Posts: 1,961
Default

Have you considered using the web browser control? If the user is already logged in via IE, then the web browser control should be logged in when you access those pages.
__________________
To err is human; to debug, divine.
Reply With Quote
  #3  
Old 06-20-2008, 08:54 AM
AtmaWeapon's Avatar
AtmaWeapon AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,416
Default

I wrote an example that logged into the forums once, but for some reason I haven't found it despite searching for it. Still, this isn't a job that necessarily requires the clunky Web Browser control.

The general methodology for logging into a web site requires you to be familiar with the web site and how it operates. An intermediate knowledge of HTML and a basic knowledge of HTTP helps a lot. You need to use tools like the IE Developer toolbar and Wireshark to investigate how the login process on the target website works.

For example, on these forums, the login form sends the username and encrypted password (and something else that I forget) as POST variables to login.php. If the login succeeds, then login.php will set some cookies to store session state (basically so the rest of the forums knows you're logged in.) It's quite simple to emulate this process using code: You create an instance of HttpWebRequest and configure it to POST to login.php, then use the GetRequestStream method to get a stream that lets you write the POST variables. You must also make sure to initialize its Cookies property with a CookieContainer. Once this is done, you use GetResponse to get an HttpWebResponse. If the username and password are correct, the request's Cookies property will be a CookieContainer that you need to use for each additional request to the forums. It sounds complicated, but it only takes about 10 or 15 lines of code.

The problem is, you're going to have to do the work of determining the login process yourself, and MS might change it one day and you'll have to change as well. It's probably better to see if Windows Live exposes some Web Services API that lets you do what you want; most sites these days are starting to do so.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #4  
Old 02-07-2009, 01:26 PM
munishsethi777 munishsethi777 is offline
Newcomer
 
Join Date: Feb 2009
Posts: 14
Default

Hi Atma..
I am using exactly what u told to.. getting cookies from headers of first request headers["Set-Cookie"] and then setting this cookie for further requests to be made..
but cant get luck for logging in.
My real open post is at

http://www.xtremevbtalk.com/showthre...02#post1319102

kindly assist..
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->