I test these code with Contact replace by Google.Contacts.Contact, and
ContactsRequest replace by Google.Contacts.ContactsRequest
and I use ContactEntry.EditUri as Uri
it is fine to update photo
Thank you for your help

On Apr 1, 10:49 pm, "Julian (Google)" <[email protected]> wrote:
> Hi,
>
> Here is an example:
>
> RequestSettings requestSettings = new RequestSettings("App-name",
> "[email protected]", "Password");
> requestSettings.AutoPaging = true;
> ContactsRequest contactsRequest = new ContactsRequest
> (requestSettings);
>
> // Contact's ID to modify
> Uri uri = new Uri("http://www.google.com/m8/feeds/contacts/user
> %40domain.com/full/1");
>
> Feed<Contact> fc = contactsRequest.Get<Contact>(uri);
> foreach (Contact contact in fc.Entries)
> {
>   System.IO.FileStream fs = new System.IO.FileStream("C:\\photo.jpg",
> System.IO.FileMode.Open);
>   contactsRequest.SetPhoto(contact, fs);
>   fs.Close();
>
> }
>
> -Julian
>
> On Mar 31, 12:43 pm, woolxiang <[email protected]> wrote:
>
>
>
> > I use C# .NET to implement my code
> > Does any one tell me how to do?
> > Thank you
>
> > On Mar 31, 3:46 am, woolxiang <[email protected]> wrote:
>
> > > Hi,
>
> > > When I use the older Google Data API
> > > there is PhotoEditUri in ContactEntry class
> > > so I could use the follow code to add/update contact's photo
> > > (ContactEntry entry was got by ContactFeed):
>
> > > System.IO.FileStream fs = new System.IO.FileStream("C:\\photo.jpg",
> > > System.IO.FileMode.Open);
> > > ContactsService.Update(entry.PhotoEditUri, fs, "image/jpg", "Contact
> > > Photo");
>
> > > but when I use Google Data API 1.4.0.2
> > > there is NO PhotoEditUri in ContactEntry class
> > > but there is PhotoEtag in ContactEntry class
>
> > > Could any one tell me how to update contact's photo with new Google
> > > Data API 1.4.0.2?
>
> > > Thank you- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Contacts API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to