我正在撰写一个小程序来显示Google帐户的所有联系人照片。我写了:
RequestSettings rs = new RequestSettings("", inputEmail.Text, inputPassword.Text);
ContactsRequest cr = new ContactsRequest(rs);
Feed<Contact> fd = cr.GetContacts();
foreach (Contact contact in fd.Entries)
{
try
{
contact.ContactEntry.
photo= Image.FromStream(cr.GetPhoto(contact));
Console.WriteLine("OK");
// ...Other work
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
但它没有用。我总是得到“Google.GData.Client.GDataNotModifiedException”错误。谁可以帮我修复它。非常感谢!
答案 0 :(得分:5)
要保存任何必须关注链接的人:
Stream s = cr.Service.Query(contact.PhotoUri);
Image img = Image.FromStream(s);