Saturday, October 20, 2012

get the file path to the root of the current web application you are running in Cassini and Visual Studio

string foo = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().
   CodeBase);
foo = foo.Replace(@"file:\", "").Replace(@"bin", "");

 
 

Namespaces: System.IO and System.Reflection

No comments:

Post a Comment