MVC 3 和 Google 通讯录 API
我正在尝试从我的应用程序以及用户的 Google Mail 联系人中删除联系人,我正在使用帮助程序文件。帮助程序文件具有以下删除方法:
public static void Delete(string pGoogleUsername, string pGooglePassword, string EditUri)
{
RequestSettings rs = new RequestSettings("myApplication", pGoogleUsername, pGooglePassword);
rs.AutoPaging = true;
ContactsRequest cr = new ContactsRequest(rs);
***ContactsQuery query = new ContactsQuery();
query.Uri = new Uri(EditUri);
AtomFeed contacts = rs.Query(query);
AtomEntry entry = new AtomEntry();
entry = contacts.Entries[0];***
entry.Delete();
}
除了星星内的代码之外,我对代码感觉还不错。我在 AtomFeed contacts = rs.Query(query); 中的“Query”一词下收到错误。
非常感谢任何帮助。
I am trying to delete contacts from my application and also from a users Google Mail contacts, which I am using a helper file for. The helper file has the following Delete method:
public static void Delete(string pGoogleUsername, string pGooglePassword, string EditUri)
{
RequestSettings rs = new RequestSettings("myApplication", pGoogleUsername, pGooglePassword);
rs.AutoPaging = true;
ContactsRequest cr = new ContactsRequest(rs);
***ContactsQuery query = new ContactsQuery();
query.Uri = new Uri(EditUri);
AtomFeed contacts = rs.Query(query);
AtomEntry entry = new AtomEntry();
entry = contacts.Entries[0];***
entry.Delete();
}
I feel okay about the code, apart from the code inside the stars. I get an error under the word "Query" in AtomFeed contacts = rs.Query(query);.
Any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看我的代码是否可以帮助您更好地获取联系人:
MVC 3和 Google Contacts API
尝试例如:
cr.Delete(entry);
或f.Entries.First()
等以下循环:See if my code here helps you get your contacts a bit better:
MVC 3 and Google Contacts API
try for instance:
cr.Delete(entry);
orf.Entries.First()
etc inside the following loop: