我正在写一个小程序来显示一个谷歌帐户的所有联系人照片。我写的:
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"错误。谁能帮我修好它。非常感谢!
为了不让任何人跟随链接:
Stream s = cr.Service.Query(contact.PhotoUri);
Image img = Image.FromStream(s);