[DllImport("shlwapi.dll", CharSet=CharSet.Auto)]
static extern int UrlCreateFromPath(
[In] string path,
[Out] StringBuilder url,
[In,Out] ref uint urlLength,
[In] object reserved
);
Declare Function UrlCreateFromPath Lib "shlwapi.dll" (TODO) As TODO
None.
Do you know one? Please contribute it!
None.
Please add some!
[STAThread]
static void Main(string[] args)
{
Console.Write(@"Enter filename: ");
string filename = Console.ReadLine();
Console.WriteLine(UrlFromPath(filename));
Console.Read();
}
private static string UrlFromPath(string filepath)
{
uint urlLength = 200;
StringBuilder url = new StringBuilder();
UrlCreateFromPath(filepath,url,ref urlLength,null);
return url.ToString();
}