Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
Created November 9, 2010 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prabirshrestha/668811 to your computer and use it in GitHub Desktop.
Save prabirshrestha/668811 to your computer and use it in GitHub Desktop.
GetPathRelativeToExecutable
public static string GetPathRelativeToExecutable(string fileName)
{
string executable = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath;
return System.IO.Path.GetFullPath(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(executable), fileName));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment