Last active
April 19, 2016 09:43
-
-
Save idiotandrobot/dbe3f27e023b74b54d774ff07a03306f to your computer and use it in GitHub Desktop.
Dropbox Windows Folder path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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