giovedì 25 ottobre 2012

C# Google API - Delete Google Contact

The following code shows a c# method to delete a google contact.

        public void DeleteContact(ContactsRequest cr, Uri contactURL)
            Contact contact = cr.Retrieve<Contact>(contactURL);

            catch (GDataVersionConflictException e)

The following code shows how to use the previous method.

            GDataCredentials Credentials = new GDataCredentials("", "yourPassword");
            RequestSettings settings = new RequestSettings("appName", Credentials);
            settings.UseSSL = true;

            ContactsRequest cr = new ContactsRequest(settings);
            Contact contatto = cr.Retrieve<Contact>(new Uri(("Contact URL"));

            DeleteContact(cr, new Uri("Contact URL"));

I want to remeber to go here to get  Application-specific password

Nessun commento:

Posta un commento