我正在创建Google集成的asp.net应用程序。我想检索在Gmail中登录用户的朋友的所有信息无法检索gmail联系人照片
。我在gridview中获得了联系人列表。但我是
无法获取任何联系人的个人资料照片。我正在GridView中动态添加数据列。
这里是我的照片检索代码:
RequestSettings rs = new RequestSettings(App_Name, Uname, Password_property);
rs.AutoPaging = true;
ContactsRequest cr = new ContactsRequest(rs);
Feed<Contact> f = cr.GetContacts();
foreach (Contact t in f.Entries)
{
Stream photo = cr.Service.Query(t.PhotoUri);
if (photo != null)
{
dr1["Profile Pic"] = System.Drawing.Image.FromStream(photo);
}
}
它崩溃并说远程服务器返回错误。
然后,我尝试另一个代码:
Stream photo = cr.GetPhoto(t);
if (photo != null)
{
dr1["Profile Pic"] = System.Drawing.Image.FromStream(photo);
}
它还崩溃,并给出了
Google.GData.Client.GDataNotModifiedException : Content not modified
错误,我不能够得到无论如何接触的照片。
任何帮助表示赞赏。
感谢
我仍然不能够得到的图像。任何人都可以提供一些代码。我迫切需要它 – Isha 2011-12-21 06:01:02