【问题标题】:Google gdata pdf download and upload谷歌 gdata pdf 下载和上传
【发布时间】:2014-01-05 21:31:09
【问题描述】:

我的问题只是下载。明天我有2个问题,他们是下载和上传。但我解决了上传问题。我可以分享这个问题答案的上传代码。但现在只有问题下载 P.S =客户端应用程序

【问题讨论】:

    标签: c# gdata


    【解决方案1】:
    var authenticator = new ClientLoginAuthenticator("ApplicationName", ServiceNames.Documents, new GDataCredentials("Username", "Password"));
    var service = new DocumentsService("ApplicationName");
    var entry = new DocumentEntry();
    entry.Title.Text = fileName;
    entry.MediaSource = new MediaFileSource(filePath, "application/pdf");
    var createUploadUrl = new Uri(String.Format(UploadPath, "uploadFileId"));
    var link = new AtomLink(createUploadUrl.AbsoluteUri);
    link.Rel = ResumableUploader.CreateMediaRelation;
    entry.Links.Add(link);
    entry.Service = service;
    var uploader = new ResumableUploader();
    var response = uploader.Insert(authenticator, entry);
    return response.ResponseUri.AbsolutePath;
    

    string UploadPath = "https://docs.google.com/feeds/upload/create-session/default/private/full/folder:{0}/contents";

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      • 2011-04-26
      • 2013-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-15
      相关资源
      最近更新 更多