Determine the Executing Application's Path (VB)

 

Question: I am developing a Compact Framework application that I want to submit for the “Will Code for Device” competition and want to determine the executing applications path. How can I do this?

 

Answer: Here is a simple function that I created that will return this information.

 

Public Function GetAppPath() As String

Return System.IO.Path.GetDirectoryName(System.Reflection.Assembly._

GetExecutingAssembly().GetName().CodeBase) & "\"

   

End Function