Question:
I am using DropBox csharp API:
https://github.com/dkarzon/DropNet
From unit tests and a single working sample from here https://github.com/dkarzon/DropNet/blob/master/DropNet.Samples/DropNet.Samples.Web/Default.aspx.cs
I realized that it works as follows:
DropNet.DropNetClient client = new DropNet.DropNetClient(strApiKey, strAppSecret); DropNet.Models.UserLogin login = client.GetToken(); client.UserLogin = login; var accountInfo = client.AccountInfo(); str = accountInfo.quota_info.quota.ToString();
It probably throws an exception on accountinfo. (System.Net.HttpStatusCode.Unauthorized) Everything before everything works fine, I get a login (usertoken and usersecret).
I think my problem is this part of the sample application:
var url = _client.BuildAuthorizeUrl(Request.Url.ToString() + "?dropboxcallback=1"); Response.Redirect(url);
Where does it redirect to Dropbox for login ... I don’t have a web application, so I don’t have a URL ...
I have a console application that should automatically backup my database automatically, as a service, for which it certainly very poorly requires a web browser and a user who must enter an email address / username + password.
How can I make a login by directly supplying a hard-coded username and password?
If I use a sample application, then it works, but it requires entering a username and password on the Internet, and it takes a lot of time for a console application ...
source share