Exemplo n.º 1
0
 public static string GetDropBoxDirectlink (ref GlobussDropboxLib.Authentication.oAuthToken _oAuthToken, string AccessToken, string path)
 {
     //    var uri = new Uri(new Uri(GlobussDropboxLib.App.Core.Global._BASIC_URI),
     //String.Format("metadata/{0}/{1}", "dropbox", "MyFolder"));
     var uri = new Uri(new Uri(GlobussDropboxLib.App.Core.Global._BASIC_URI), String.Format("media/auto/{0}", path));
     return _oAuthToken.APIWebRequest(GlobussDropboxLib.Authentication.oAuthToken.Method.GET.ToString(), uri + "?access_token=" + AccessToken, null);
 }
Exemplo n.º 2
0
        //[WebMethod]
        //[ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
        public bool AddUserInfo(String _UserDetail, string UserId, string _AccessToken, GlobussDropboxLib.Authentication.oAuthToken _oAuthToken)
        {
            var _OBJ_User = Newtonsoft.Json.Linq.JObject.Parse(_UserDetail);
            DropboxAccountRepository _DropboxAccountRepository = new DropboxAccountRepository();

            Domain.Socioboard.Domain.DropboxAccount _DropboxAccount = new Domain.Socioboard.Domain.DropboxAccount();
            //User user = (User)Session["LoggedUser"];
            Guid _UserId = Guid.Parse(UserId);

            _DropboxAccount.Id = Guid.NewGuid();
            _DropboxAccount.UserId = _UserId;
            _DropboxAccount.DropboxUserName = _OBJ_User["display_name"].ToString();
            _DropboxAccount.DropboxUserId = _OBJ_User["uid"].ToString();
            _DropboxAccount.DropboxEmail = _OBJ_User["email"].ToString();
            _DropboxAccount.AccessToken = _AccessToken;
            _DropboxAccount.OauthToken = _oAuthToken.Token;
            _DropboxAccount.OauthTokenSecret = _oAuthToken.TokenSecret;
            _DropboxAccount.CreateDate = DateTime.Now;
            _DropboxAccountRepository.Add(_DropboxAccount);
            return true;
        }
Exemplo n.º 3
0
 public static string GetUserInfo(ref GlobussDropboxLib.Authentication.oAuthToken _oAuthToken, string AccessToken)
 {
     return _oAuthToken.APIWebRequest(GlobussDropboxLib.Authentication.oAuthToken.Method.GET.ToString(), GlobussDropboxLib.App.Core.Global._USER_INFO + "?access_token=" + AccessToken, null);
 }
Exemplo n.º 4
0
        public static string GetDropBoxFolder(ref GlobussDropboxLib.Authentication.oAuthToken _oAuthToken, string AccessToken)
        {
            var uri = new Uri(new Uri(GlobussDropboxLib.App.Core.Global._BASIC_URI), String.Format("metadata/{0}/{1}", "dropbox", string.Empty));

            return _oAuthToken.APIWebRequest(GlobussDropboxLib.Authentication.oAuthToken.Method.GET.ToString(), uri + "?access_token=" + AccessToken, null);
        }