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

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.