Pages

Thursday, 8 September 2011

How Get Gmail Addresses in your c sharp asp.net Application

Get your email address in asp.net application.
Step 1> Create New Asp.Net application.
Step 2 > First Add the Google Data API  in your project show follows.
code
1
2
3
4
using Google.GData.Contacts;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.Contacts;
using Google.GData.Contacts;using Google.GData.Client;using Google.GData.Extensions;using

Step 3 >Then Add 2 TextBox , one ListBox and one button in your page.
                   textBox1 for Email ID
                  textBox2 for Password
                  ListBox1 for display Email Address.
Step 4 > Write or Past following code in button click event.

rs.AutoPaging =



{

ListBox1.Items.Add(c.Title);

{

ListBox1.Items.Add(
}
}
RequestSettings rs = new RequestSettings("", TextBox1.Text, TextBox2.Text);true;ContactsRequest cr = new ContactsRequest(rs);Feed<Contact> feed = cr.GetContacts();foreach (Contact c in feed.Entries)Debug.WriteLine("\t" + c.Title);foreach (EMail email in c.Emails)Debug.WriteLine("\t" + email.Address);" " + email.Address);
code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
RequestSettings rs = new RequestSettings("", TextBox1.Text, TextBox2.Text);
           rs.AutoPaging = true;
           ContactsRequest cr = new ContactsRequest(rs);
           Feed<Contact> feed = cr.GetContacts();
           foreach (Contact c in feed.Entries)
           {
               Debug.WriteLine("\t" + c.Title);
               ListBox1.Items.Add(c.Title);
               foreach (EMail email in c.Emails)
               {
                   Debug.WriteLine("\t" + email.Address);
                   ListBox1.Items.Add("  " + email.Address);
               }
           }
Google.Contacts; 

0 comments:

Post a Comment