|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
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
Show quote
Hide quote
On Fri, 16 Jun 2006 20:55:02 -0600, "gs" <gs@dontMail.telus> wrote: Application.ExecutablePath is a valid statement, but it's name is a>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 > 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 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 > "gs" <gs@dontMail.telus> schrieb: Make sure your project contains a reference to "System.Windows.Forms.dll".> Dim appPathFn As String > > appPathFn = System.Windows.Forms.Application.ExecutablePath > > Windows is not a member of System -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> 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/> |
|||||||||||||||||||||||