czwartek, 17 listopada 2011

Import Contacts From Gmail, Yahoo, Hotmail Asp.Net

Import contacts from Gmail, Yahoo, Hotmail.

I spend a few days to configure how to import contacts in my application. You can find a lot of information in
internet, but it very hard to find something really handy. I won't describe step by step how you can do that. You can
download project and check it yourself. To make it works in Visual Studio you need to add host
entry "" to C:\Windows\System32\drivers\etc\hosts (You need to have port 80 free on your local IIS).
When you start the project change url from  localhost to and it should work.

All needed dlls should be in project, but if somebody want to create project from scratch I will describe few main steps:


1. Register your application to get consumer key and consumer secret
    Don't forgot to change prermision to read Contacts
2. Download and extract DotNetOpenAuth- from
3. Add DotNetOpenAuth.dll to project references
4. Download file OAuthBase.cs from and add to project


1. Register your application to get Client ID and Client Secret
2. Download and install Windows Live ID Delegated Authentication SDK 1.2
3. Add file windowsLiveLogin.cs to Project. It should be in C:\Program Files\Windows Live ID\DelAuth\App_Code


1. Register your application to get Client ID and Client Secret
2. Download Google_Data_API_Setup_1.9.0.0.msi from
3. Add references Google.GData.Client, Google.GData.Contacts, Google.GData.Extensions to Project. Files should be in folder C:\Program Files\Google\Google Data API SDK\Redist

If this post help you , you can buy me a beer.

3 komentarze:

  1. Hi! This is indeed very great work. I am trying to re-write this in mvc 4. If i succeed I will submit it to you so you could upload it. Thank you so much!

  2. What I do not understand is, after the re-direct from the Yahoo or Google authenticated, nothing happens. At which point will I intercept and get the contacts?

  3. hey finally i can reach you this code is really works and save my life :D but...

    i cannot give this return value shit and

    i cannot get hotmail contacts how can i get them?