Results 1 to 4 of 4

Thread: Knowing the path of my project...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849

    Question Knowing the path of my project...

    Hello!!

    I am making a dll and want to know at run-time in which folder it is
    installed.
    how can I do that?

    thanks!!!
    Dekel C.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Knowing the path of my project...

    You know the location of the executable from Application.StartupPath. If your library may be in another location then you could use reflection:
    Code:
    System.Reflection.Assembly.GetExecutingAssembly().Location;
    There are some provisos with that property though, so you should read its help topic.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849

    Re: Knowing the path of my project...

    ok... thats' great for applications...

    but what if I have a dll that I built and want to get his path from the
    run-time of the dll?
    Dekel C.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Knowing the path of my project...

    GetExecutingAssembly gets a reference to the current assembly, whatever that is.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width