C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Many ways to get your application path


Posted Date: 24 Feb 2007    Resource Type: Code Snippets    Category: Process

Posted By: Balamurali Balaji       Member Level: Diamond
Rating:     Points: 10



There are always more than one solution to a single problem. Just to get your application path (including the exe name or not), you may use any of the following codelines.


// The following returns the application executable path with exe name
Console.WriteLine(System.Environment.CommandLine);
// or
Console.WriteLine(System.Windows.Forms.Application.ExecutablePath);
// or
Console.WriteLine(System.Reflection.Assembly.GetExecutingAssembly().Location);

// The following returns just the application executable path
Console.WriteLine(System.Environment.CurrentDirectory);
// or
Console.WriteLine(System.IO.Directory.GetCurrentDirectory());
// or
Console.WriteLine(System.Windows.Forms.Application.StartupPath);
// or
Console.WriteLine(System.AppDomain.CurrentDomain.BaseDirectory);
// or
Console.WriteLine(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);




Responses


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

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

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: How to restrict a program to a single instance
Previous Resource: Open a URL in Internet Explorer using Process.Start
Return to Discussion Resource Index
Post New Resource
Category: Process


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use