|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Get Application EXE name in VS.2005How does one get the name of the executable that is running in VS.2005
using VB.net. I have looked at the my.application object but I can only find My.Application.Info.DirectoryPath which does not include the executable name. Thanks in Advance Laurence Larry wrote:
> How does one get the name of the executable that is running in VS.2005 I use Application.ProductName.> using VB.net. I have looked at the my.application object but I can > only find My.Application.Info.DirectoryPath which does not include the > executable name. > > Thanks in Advance > > Laurence Set in the Assembly Info window. Larry wrote:
> How does one get the name of the executable that is running in VS.2005 Sorry, misread your question. The EXE filename should be in:> using VB.net. I have looked at the my.application object but I can > only find My.Application.Info.DirectoryPath which does not include the > executable name. > > Thanks in Advance > > Laurence Application.ExecutablePath An easy way to glean out the EXE filename, use the FileInfo class. Is that My.application.ExecutablePath?
I don't see it in the my.application object, nor do I see an Application object any where. Laurence za***@construction-imaging.com wrote: Show quoteHide quote > Larry wrote: >> How does one get the name of the executable that is running in VS.2005 >> using VB.net. I have looked at the my.application object but I can >> only find My.Application.Info.DirectoryPath which does not include the >> executable name. >> >> Thanks in Advance >> >> Laurence > > Sorry, misread your question. The EXE filename should be in: > > Application.ExecutablePath > > An easy way to glean out the EXE filename, use the FileInfo class. > its just as Zach said
Me.Label1.Text = Application.ExecutablePath no me, no my, just Application -- -iwdu15 "iwdu15" <jmmgoalsteratyahoodotcom> schrieb: It's 'System.Windows.Forms.Application'.> Me.Label1.Text = Application.ExecutablePath > > no me, no my, just Application -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> When I type "Application" I do not get a "." or intellisense,
I do have Windows.Systems.Forms under my references folder. Is it because this is a class Library project? I created a new windows project and when I type "Application" I do get the dot and intellisense. There must be something different about a Class library project. Thank You for you help. Laurence Herfried K. Wagner [MVP] wrote: Show quoteHide quote > "iwdu15" <jmmgoalsteratyahoodotcom> schrieb: >> Me.Label1.Text = Application.ExecutablePath >> >> no me, no my, just Application > > It's 'System.Windows.Forms.Application'. > When I type "system.Windows.Forms.Application." then I get the dot
and intellisense. I placed an "Inherits System.Windows.Forms.Form" at the top of the class, but typing in "Application." still doesn't do anything, I still have to type "system.Windows.Forms.Application." Laurence Herfried K. Wagner [MVP] wrote: Show quoteHide quote > "iwdu15" <jmmgoalsteratyahoodotcom> schrieb: >> Me.Label1.Text = Application.ExecutablePath >> >> no me, no my, just Application > > It's 'System.Windows.Forms.Application'. > I put in an "imports.System.Windows.Forms"
and now it is working, Thank You for your help, Laurence Herfried K. Wagner [MVP] wrote: Show quoteHide quote > "iwdu15" <jmmgoalsteratyahoodotcom> schrieb: >> Me.Label1.Text = Application.ExecutablePath >> >> no me, no my, just Application > > It's 'System.Windows.Forms.Application'. > Larry wrote:
Show quoteHide quote > I put in an "imports.System.Windows.Forms" Don't tell us, your app is not a standard windows app, right? Maybe a> and now it is working, > > Thank You for your help, > > Laurence > > Herfried K. Wagner [MVP] wrote: > > "iwdu15" <jmmgoalsteratyahoodotcom> schrieb: > >> Me.Label1.Text = Application.ExecutablePath > >> > >> no me, no my, just Application > > > > It's 'System.Windows.Forms.Application'. > > Console app? If you create an using the standard windows application template, System.Windows.Forms is automatically included and you do not have to Imports it anywhere. My App is a class library, to be compiled into a DLL.
If you create a new project as a windows app, it comes with the System.Windows.Forms. When you create a new project as a Class Library, it doesn't come with System.Windows.Forms. Even when you add a reference to the system.windows.forms under a reference folder, you still have to have "Imports System.Windows.Forms" to get at the Application Object. Laurence za***@construction-imaging.com wrote: Show quoteHide quote > Larry wrote: >> I put in an "imports.System.Windows.Forms" >> and now it is working, >> >> Thank You for your help, >> >> Laurence >> >> Herfried K. Wagner [MVP] wrote: >>> "iwdu15" <jmmgoalsteratyahoodotcom> schrieb: >>>> Me.Label1.Text = Application.ExecutablePath >>>> >>>> no me, no my, just Application >>> It's 'System.Windows.Forms.Application'. >>> > > Don't tell us, your app is not a standard windows app, right? Maybe a > Console app? If you create an using the standard windows application > template, System.Windows.Forms is automatically included and you do not > have to Imports it anywhere. > Laurence wrote:
> Is that My.application.ExecutablePath? Not sure what is going on. I enter Application and hit the dot, and a> > I don't see it in the my.application object, > nor do I see an Application object any where. > > Laurence list of properties show up from Intellisense. Show quoteHide quote > > za***@construction-imaging.com wrote: > > Larry wrote: > >> How does one get the name of the executable that is running in VS.2005 > >> using VB.net. I have looked at the my.application object but I can > >> only find My.Application.Info.DirectoryPath which does not include the > >> executable name. > >> > >> Thanks in Advance > >> > >> Laurence > > > > Sorry, misread your question. The EXE filename should be in: > > > > Application.ExecutablePath > > > > An easy way to glean out the EXE filename, use the FileInfo class. > > yea, its supposed to. Not everything has to start with "Me" or "My"....im
confused on what your confused about? -- -iwdu15 i keep thinking of more ways to explain it....
Application is under the System namespace, and since your importing the System namespace automatically, its the same as typing System.Application hope that explains it a lil better -- -iwdu15 there are Objects and Classes that arent part of your form or project...so
they cant be accessed using "Me.". Application is a good example of that. There are many many many more things that are accessed without the Me (or My in 2005) keyword(s).... -- -iwdu15
Textbox LostFocus event fires after Command Button's OnClick event
About Adding controls dynamically VB6 and ms SQL 2005 DATETIME Messagebox Issue Variable function activation select stmt Cache panels Delay in making control visible when connecting to database Sending an e-mail on a wireless network Route planning |
|||||||||||||||||||||||