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

Comments (1)

  1. BillT says:

    System.IO.Path.DirectorySeparatorChar is supported in .NET Compact Framework – Windows CE .NET. You may (or may not) want to use that instead of "".