Chorn Sokun's Weblog

Conquer inner fear, push it to the limit!

Archive for September 2010

Relative local file path to Uri

leave a comment »

It just another weekend in my life time; let write a few line of code for fun.

// Do you know you can easily conver file with relative path to an Uri object?
// of cause you do :D
var fileInfo = new FileInfo(@"..\Files\TGIS.xls");
var uri = new Uri(fileInfo.Fullname);

Hope you enjoy your weekend :D

Written by Chorn Sokun

September 11, 2010 at 10:27 am

Posted in Tips & Tricks