Home All Groups Group Topic Archive Search About
Author
17 Jun 2006 2:55 AM
gs
Dim appPathFn As String

appPathFn = System.Windows.Forms.Application.ExecutablePath

         Windows is not a member of System

I saw come code in the internet as

appPathFn = Application.ExecutablePath
  but that does not work for me


I am using visual basic .net express 2005. don't know if that make any
difference.  So far Google has not helped me yet

Author
17 Jun 2006 4:33 AM
gene kelley
Show quote Hide quote
On Fri, 16 Jun 2006 20:55:02 -0600, "gs" <gs@dontMail.telus> wrote:

>Dim appPathFn As String
>
>appPathFn = System.Windows.Forms.Application.ExecutablePath
>
>         Windows is not a member of System
>
>I saw come code in the internet as
>
>appPathFn = Application.ExecutablePath
>  but that does not work for me
>
>
>I am using visual basic .net express 2005. don't know if that make any
>difference.  So far Google has not helped me yet
>

Application.ExecutablePath is a valid statement, but it's name is a
bit misleading.  The statement actually returns the location of and
the name of the executable file as one concacted string.

If you are looking for the path only where the application's
executable is located, try:
My.Application.Info.DirectoryPath

Gene
Author
17 Jun 2006 5:51 AM
Cor Ligthert [MVP]
In addition to Gene

application.startuppath

Cor

Show quoteHide quote
"gs" <gs@dontMail.telus> schreef in bericht
news:%23SZvIkbkGHA.1936@TK2MSFTNGP04.phx.gbl...
> Dim appPathFn As String
>
> appPathFn = System.Windows.Forms.Application.ExecutablePath
>
>         Windows is not a member of System
>
> I saw come code in the internet as
>
> appPathFn = Application.ExecutablePath
>  but that does not work for me
>
>
> I am using visual basic .net express 2005. don't know if that make any
> difference.  So far Google has not helped me yet
>
Author
17 Jun 2006 11:12 AM
Herfried K. Wagner [MVP]
"gs" <gs@dontMail.telus> schrieb:
> Dim appPathFn As String
>
> appPathFn = System.Windows.Forms.Application.ExecutablePath
>
>         Windows is not a member of System

Make sure your project contains a reference to "System.Windows.Forms.dll".

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
17 Jun 2006 8:15 PM
gs
thank you very much  for telling me making a reference to
system.windows.forms.... I add reference to System.Windows.Form...., now I
got the Application.ExecutablePath recognized.

Prior to that "import System.Windows" does not work not using the fully
qualified name for Application.

I guess most people and articles assume this reference as basic and  common
knowledge but I am just an occasional vb programmer supplementing some
legacy application with new functionality.



Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:uFDMb7fkGHA.408@TK2MSFTNGP03.phx.gbl...
> "gs" <gs@dontMail.telus> schrieb:
>> Dim appPathFn As String
>>
>> appPathFn = System.Windows.Forms.Application.ExecutablePath
>>
>>         Windows is not a member of System
>
> Make sure your project contains a reference to "System.Windows.Forms.dll".
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>