I can see, by your response to my comment on your question, that you have already figured out the essential aspect of accessing files in your own DropBox, on your own computer.
Yes, DropBox files in the Public folder, on your machine, use a hard-coded six-digit ID number; however, shared files (in a shared folder) will have a dynamically assigned ID number.
Here's some working code pulled from a small Windows Forms test-project I did: note, that, in this project, this is hard-coded for the DropBox folder being on the DeskTop.
Since DropBox does not provide any "public link" to a folder inside the Public folder, the display by this program of folder names preceded by the kind of id you'd want to see on a Public link to a file: is kind of mis-leading: but, I wanted to see the folders separately, as I was developing this little test-bed, for verification purposes, and that's why a 'parse folders only' option is there.
using System;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
namespace Get_DropBox_Public_Links
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private string DBoxPublicLinkHeader = @"https://dl.dropbox.com/u/123456/";
private string replaceSpaceStr = @"%20";
private string oneSpace = @" ";
private string newLine = Environment.NewLine;
private string DTopFolderPath;
private string DBoxFolderPath;
private string[] DBoxFolderFiles;
private string[] DBoxFolderDirectories;
private string rawLinkPath;
private string[] whatToParse;
private int startOfRawLink;
private void Form1_Load(object sender, EventArgs e)
{
DTopFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
DBoxFolderPath = DTopFolderPath + @"\DropBox\Public";
DBoxFolderFiles = Directory.GetFiles(DBoxFolderPath);
DBoxFolderDirectories = Directory.GetDirectories(DBoxFolderPath);
startOfRawLink = DBoxFolderPath.Length + 1;
}
private void btnParseDropBoxPublicFolder_Click(object sender, EventArgs e)
{
tbDropBoxPublicFolderPath.Text = DBoxPublicLinkHeader;
tbDropBoxPublicParseResults.Clear();
if (rbParseRecursive.Checked)
{
RecursiveParse(DBoxFolderFiles, DBoxFolderDirectories);
return;
}
whatToParse = rbParseTopLevelFiles.Checked ? DBoxFolderFiles : DBoxFolderDirectories;
foreach (string theFilePath in whatToParse)
{
rawLinkPath = DBoxPublicLinkHeader + theFilePath.Substring(startOfRawLink);
rawLinkPath = rawLinkPath.Replace(oneSpace, replaceSpaceStr);
tbDropBoxPublicParseResults.Text += rawLinkPath + newLine;
}
}
private void RecursiveParse(string[] theFiles, string[] theDirectories)
{
foreach (string theFilePath in theFiles)
{
rawLinkPath = DBoxPublicLinkHeader + theFilePath.Substring(startOfRawLink);
rawLinkPath = rawLinkPath.Replace(oneSpace, replaceSpaceStr);
tbDropBoxPublicParseResults.Text += rawLinkPath + newLine;
}
foreach (string theDirectoryPath in theDirectories)
{
tbDropBoxPublicParseResults.Text += newLine
+ "Directory: "
+ theDirectoryPath
+ " Total Files = "
+ theFiles.Length.ToString()
+ newLine;
RecursiveParse(Directory.GetFiles(theDirectoryPath),
Directory.GetDirectories(theDirectoryPath));
}
}
}
}