Results 1 to 7 of 7

Thread: [RESOLVED] [2008] Getting the path of the application

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2008
    Location
    Greece
    Posts
    64

    Resolved [RESOLVED] [2008] Getting the path of the application

    How I can make my application showing a msgbox of the path where my application is saved? I mean, how I can get it to tell me "ex. C:\Temp"?

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2008] Getting the path of the application

    VB.NET Code:
    1. Application.StartupPath
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2008
    Location
    Greece
    Posts
    64

    Re: [2008] Getting the path of the application

    It was so simple, damn it I am so damn stupid. Thanks Atheist.

  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [2008] Getting the path of the application

    It only seems obvious/simple once you know
    Dont forget to mark this thread as resolved
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2008
    Location
    Greece
    Posts
    64

    Re: [RESOLVED] [2008] Getting the path of the application

    One more Question, How I can use it If I want to do this
    Instead of using C:\Temp\file.exe using Application.StartUpPath & File.exe
    How I can do that?

  6. #6
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] [2008] Getting the path of the application

    You can use IO.Path.Combine, like this
    vb.net Code:
    1. IO.Path.Combine(Application.StartUpPath, "File.exe")
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  7. #7
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [RESOLVED] [2008] Getting the path of the application

    In what context? Use Path.Combine to join two paths:
    Code:
    Dim path As String = System.IO.Path.Combine(Application.StartUpPath, "File.exe")
    Edit: Aargh!
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

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