-
February 2nd, 2005, 09:59 AM
#1
Detecting the name of an application?
How would you code a VB.net application to detect it's own name, even after the end-user has renamed it?
For example, say you write a quick program whose name is Cheez-It.exe, which when you open, simply displays its name (Cheez-It.exe) in a label. If it were then renamed Pop-Tart.exe, and re-opened, the name Pop-Tart.exe would appear in the label instead. Is there a way to code this?
-
February 2nd, 2005, 11:27 AM
#2
Re: Detecting the name of an application?
Try Application.ProductName
-
February 2nd, 2005, 11:30 AM
#3
Re: Detecting the name of an application?
System.Diagnostics.Process.GetCurrentProcess.ProcessName
-
February 2nd, 2005, 12:14 PM
#4
Re: Detecting the name of an application?
Originally Posted by SatyaV
System.Diagnostics.Process.GetCurrentProcess.ProcessName
Well I feel awefully stupid for missing that, seeing as my application involves managing processes! I'll try it and see. Thanks!
-
February 2nd, 2005, 12:45 PM
#5
Re: Detecting the name of an application?
Well that was close... It is actually:
System.Diagnostics.Process.GetCurrentProcess.ToString
which formats the name of the process as a string. But you got me on the right track!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|