For Windows Forms applications, you can use the read-only static property System.Windows.Forms.Application.StartupPath
Another option is to use the static method System.IO.Directory.GetCurrentDirectory(). This returns the current working directory, which isn't necessarily the application path. However, you can call this method immediately after launching the application and store the return value in a variable to preserve the original application path.
Look into the Application class. There are many static properties off of
this object. The one you are looking for is Application.StartupPath I
believe. There is also the ExecutablePath property that might be of some
use to you.
C Addison Ritchie, MCSD.NET
Ritch Consulting, Inc.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.