Getting applications Paths

Does the System Namespace has something like system.path I need print out the current cs files path.. because for some reason I'm trying to load some images in a program that I'm creating.. but for some reason.. It only works when I add in the full path to it.



Answer this question

Getting applications Paths

  • pauley

    interesting, it should. It returns a string of the path/location of where your application is running from

    MessageBox.Show(Application.StartupPath);

    (or Console.Write)



  • PremZ

    ahmedilyas wrote:
    or Application.StartupPath
    Application.StartupPath did nothing for me. I tried printing it out and it didnt print anything out.


  • itsRashmi

    The path that I am currently working on. (i.e: c:\c-sharp)


  • Cygon4

    no worries ;-) got me worried too!

  • Rachel J

    or Application.StartupPath

  • tarzan123_us

    Then that's Environment.CurrentDirectory.
  • Simpson474

    What path are you really after It's not very clear from your question.

    You have:

    System.Environment.CurrentDirectory for the current directory

    System.Environment.GetFolderPath(SpecialFolder specialFolder) for various system folders like My Documents, Application Data etc.

    System.Windows.Forms.Application.StartupPath for the path where the app's executable resides in


  • Lilach

    hmm weird.. you know what.. it did work.. but last night when I tryied it it didn't heh!!!! anyways.. thanx bro.. maybe I was to sleepy to see it. sorry.


  • Getting applications Paths