• How to import Gmail contacts in C# application

    by  • April 16, 2014 • Microsoft .NET C# (C-Sharp), Microsoft ASP.NET • 0 Comments

    A good application, for users, is one that minimizes the user efforts when using an application. So most of the social networking and other sites provide the facility for users to send request or invite friends by importing contacts from Gmail, Yahoo, MSN etc. We may need to use user Gmail, Yahoo, MSN contacts for other purposes so we have to import these contacts and use it for our purposes. Recently I was working on an application and I was in need to import user contacts only from Gmail so I have written code for this purpose. I am sharing this code snippet with you.

    You just need to use Google data API in your application to import Gmail contacts. So download Google data API and add references for following DLLs in your application.





    Add a class in your application as below




    Now add following code snippet to import Gmail contacts


    As you can see we need login information of the user to import contacts of that user. Then we just need to call the GetContact() method of the ContactsRequest object. Well, at the end you can use these contacts for your purpose. I am looping through this contact list which i have imported and just displaying the title and email address of every contact.

    Download complete application code from below link.

    Download540 downloads

    Best WordPress Themes and Plugins with Great Team and Support!

    Avatar of GetCodeSnippet.com


    GetCodeSnippet.com provides you high quality Microsoft .NET development related articles, tutorials and sample code for ASP.NET, C#, VB.NET, AJAX, WCF, WPF, Web Services, Windows Services, SQL Server and other technologies.

    Leave a Reply