C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Tips » Windows »

.NET Windows Forms - Find the executable path of current application


Posted Date: 26 Jun 2009    Resource Type: Tips    Category: Windows
Author: Viji RAJKUMARMember Level: Diamond    
Rating: 1 out of 5Points: 4



There are two ways to find the path the current running application.


1. Using Application.ExecutablePath

2. System.Reflection.Assembly.GetExecutingAssembly()

Prerequisties:

Import the System.Reflection name space in the top of the windows Form

Example:



Imports System.Reflection

Public Class Form1

....

Private Sub FindPathOfExe()

Dim appPath as String

'Method 1

appPath = Application.ExecutablePath

Debug.Print "Application path: " & appPath

'Method 2
appPath = System.Reflection.Assembly.GetExecutingAssembly().Location


Debug.Print "Application path: " & appPath


End Sub

End Class





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
.NET Windows Forms - Find the executable path of current application  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Folder lock using command prompt
Previous Resource: .NET Windows Forms - Find the Operating System Version
Return to Discussion Resource Index
Post New Resource
Category: Windows


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use