我有一个 MVC 网站,我在其中使用DropNet Api。
public ActionResult AuthorizeDropBox()
{
try
{
var _client = new DropNetClient("API KEY", "API SECRET");
if (_client == null)
throw new DropboxException();
var userLogin = _client.GetToken();
var url = _client.BuildAuthorizeUrl(userLogin, Url.Action("DropBoxCallBack", "Account", null, Request.Url.Scheme));
return Redirect(url);
}
catch (DropboxException dbe)
{
}
}
public ActionResult DropBoxCallBack()
{
//Not sure here how to access the Dropbox api
//var fileBytes = _client.GetFile("/Getting Started.pdf");
return View();
}
所以我将用户重定向到 Dropbox 页面,该页面询问用户是否允许我的网站连接他的数据,然后我DropBoxCallBack
就被提出来了。
不过我_client
这里没有。但我什至尝试打开_client
,Session
但在尝试访问 Dropbox 功能时仍然出现错误。
任何帮助,将不胜感激。
谢谢