How to get the current path - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to get the current path

lee_slee_s Posts: 116Member
Hi
I know that in vb its: App.Path

But how do i do this in vb.net?

Comments

  • Chris__BChris__B Posts: 51Member
    Hi,

    I'm not sure if there's an easier way but here's a possibility
    [code]
    Dim sPath As String
    Dim nIndex As Integer
    sPath = Trim(System.Reflection.Assembly.GetExecutingAssembly().Location)
    nIndex = sPath.LastIndexOf("")
    sPath = sPath.Substring(0, nIndex)

    [/code]
    Cheers,
    Chris

    : Hi
    : I know that in vb its: App.Path
    :
    : But how do i do this in vb.net?
    :

  • iwilld0itiwilld0it Posts: 1,134Member
    : Hi
    : I know that in vb its: App.Path
    :
    : But how do i do this in vb.net?
    :

    You can try parsing it out of this property ...

    [code]
    Dim currPath As Strin = Environment.CurrentDirectory()
    [/code]
Sign In or Register to comment.