Skip to content

Instantly share code, notes, and snippets.

@idiotandrobot
Last active April 19, 2016 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idiotandrobot/dbe3f27e023b74b54d774ff07a03306f to your computer and use it in GitHub Desktop.
Save idiotandrobot/dbe3f27e023b74b54d774ff07a03306f to your computer and use it in GitHub Desktop.
Dropbox Windows Folder path
using Newtonsoft.Json.Linq;
using System;
using System.IO;
public static class Dropbox
{
private static string _Path;
public static string Path
{
get { return _Path ?? (_Path = GetPath()); }
}
static string GetPath()
{
var appDataPath = Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData);
var filePath = System.IO.Path.Combine(appDataPath, @"Dropbox\info.json");
dynamic dropboxInfo = JObject.Parse(File.ReadAllText(filePath));
string folderPath = dropboxInfo.personal.path;
return folderPath;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment