有沒有人用過google-gdata的「新DocumentsList API」?新的Google DocumentsList API .NET客戶端?
我想檢索一個文件列表,我遇到了驗證問題。
使用Google.GData.Documents類工作正常,但是當我嘗試以類似的方式使用,然後更新Google.GData.Docs我得到一個401
如果有幫助,我已經注意到,我的電子郵件地址不會附加到網址中,就像我使用Google.GData.Documents時一樣。
任何人都可以幫忙嗎?
感謝
代碼的要求:
[Authorize]
public void ListAsync()
{
string requestorId = "";
if (Session["email"] != null)
{
// get a documents list for the user that logged in
requestorId = Session["email"].ToString();
}
// create an OAuth factory to use
GOAuthRequestFactory requestFactory = new GOAuthRequestFactory("writely", APPLICATION_NAME);
requestFactory.ConsumerKey = "XXX";
requestFactory.ConsumerSecret = "YYY";
DocsService service = new DocsService(APPLICATION_NAME);
// this way does work
//service.setUserCredentials("username", "password");
// this way doesn't work
service.RequestFactory = requestFactory;
Uri queryUri = new Uri("https://docs.google.com/feeds/default/private/full");
service.AsyncOperationCompleted += DocsQueryCompleted;
AsyncManager.OutstandingOperations.Increment();
service.QueryFeedAync(queryUri, DateTime.MinValue, this);
}
發佈您的代碼。刪除所有私人信息並在其位置使用示例值。一旦你有問題的代碼,我會扭轉我的downvote。 – 2012-01-31 13:14:15