var outPutDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly(). CodeBase);
var iconPath = Path.Combine(outPutDirectory, "FolderImg.jpg");
string icon_path = new Uri(iconPath ).LocalPath;
Uri file = new Uri(@"c:fooarloplap.txt");
// Must end in a slash to indicate folder
Uri folder = new Uri(@"c:fooar");
string relativePath =
Uri.UnescapeDataString(
folder.MakeRelativeUri(file)
.ToString()
.Replace('/', Path.DirectorySeparatorChar)
);
var myIcon = Resources.MyIconFile;