【发布时间】:2012-12-17 05:42:40
【问题描述】:
我正在创建 Google 集成的 asp.net 应用程序。我想检索所有信息
在 gmail 中登录用户的朋友。我得到了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
无论如何我都无法获取联系人照片。
感谢任何帮助。
谢谢
【问题讨论】:
-
我仍然无法获取图像。谁能提供一些代码。我迫切需要它
标签: c# asp.net google-api