title: DropNet DropBox login, how to do it programmatically in a console application?
body: <p>Question:</p>
  
  <p>I'm using a DropBox csharp API from here:<br />
  <a href="https://github.com/dkarzon/DropNet" rel="noreferrer">https://github.com/dkarzon/DropNet</a></p>
  
  <p>From the Unit tests, and the only working sample from here
  <a href="https://github.com/dkarzon/DropNet/blob/master/DropNet.Samples/DropNet.Samples.Web/Default.aspx.cs" rel="noreferrer">https://github.com/dkarzon/DropNet/blob/master/DropNet.Samples/DropNet.Samples.Web/Default.aspx.cs</a></p>
  
  <p>I figured that it works like this:</p>
  
  <pre><code>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();
  </code></pre>
  
  <p>The probem is, it throws an exception on accountinfo. (System.Net.HttpStatusCode.Unauthorized)
  Everything before works fine, I get the login (usertoken &amp; usersecret) .</p>
  
  <p>I think my problem is this part of the sample application:</p>
  
  <pre><code>var url = _client.BuildAuthorizeUrl(Request.Url.ToString() + "?dropboxcallback=1");
  Response.Redirect(url);
  </code></pre>
  
  <p>Where it redirects to dropbox for a login...
  I don't have a web application, so I have no URL...</p>
  
  <p>What I have is a console application, that should make a backup of my database every evening automatically as a service, for which it certainly is very bad requiring a webbrowser and a user which has to type in email/username + password.</p>
  
  <p>How can I do a login by directly supplying the hardcoded username and password ?</p>
  
  <p>If I use the sample application, then it works, but that requires typing in the username and password on the web, and that sucks big time for a console application...</p>