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