Import Gmail contacts in Asp.net application

Its very simple to import contact from Gmail account. We need add four references in our application. like

Google.Contacts.dll;
Google.GData.Client.dll;
Google.GData.Contacts.dll;
Google.GData.Extensions.dll;

Add name space on the top of the page:

using Google.Contacts;
using Google.GData.Client;
using Google.GData.Contacts;
using Google.GData.Extensions;

Code behind code:

   <form id="form1" runat="server">
   <div>
 
        <b>Email Address : </b>
        <br />
        <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
        <br />
        <br />
        <b>Password : </b>
        <br />
        <asp:TextBox ID="txtPassword" runat="server" TabIndex="1" TextMode="Password"></asp:TextBox>
        <br />
        <br />
        <asp:Button ID="btnContacts" runat="server" onclick="btnContacts_Click" 
            TabIndex="2" Text="Import Contacts" Width="125px" />
        <br />
        <br />
        <br />
        <b>Contacts:<br />
        </b>
        <asp:ListBox ID="lstContacts" runat="server" Height="176px" Width="229px">
        </asp:ListBox>
        <br />
        <br />
 
    </div>
    </form>

C# code:

protected void btnContacts_Click(object sender, EventArgs e)
    {
        //Provide Login Information
        RequestSettings rsLoginInfo = new RequestSettings("", txtEmail.Text, txtPassword.Text);
        rsLoginInfo.AutoPaging = true;
 
        // Fetch contacts and dislay them in ListBox
        ContactsRequest cRequest = new ContactsRequest(rsLoginInfo);
        Feed<Contact> feedContacts = cRequest.GetContacts();
        foreach (Contact gmailAddresses in feedContacts.Entries)
        {
            Console.WriteLine("\t" + gmailAddresses.Title);
            lstContacts.Items.Add(gmailAddresses.Title);
            foreach (EMail emailId in gmailAddresses.Emails)
            {
                Console.WriteLine("\t" + emailId.Address);
                lstContacts.Items.Add(" " + emailId.Address);
            }
        }
    }