Results 1 to 5 of 5

Thread: Get Full Path of selected file

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2013
    Location
    Minneapolis, MN
    Posts
    531

    Get Full Path of selected file

    Hello:

    Apparently, this is rocket science.

    In System.IO, can I just return the full path of a file I have currently selected? Or even just the full filename would work.

  2. #2
    Fanatic Member
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    750

    Re: Get Full Path of selected file

    Depends what you mean by "currently selected". IO.Path can get all manner of stuff from a string containing a filepath/filename, such as GetFileName, GetFullPath, GetFileNameWithoutExtension etc.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2013
    Location
    Minneapolis, MN
    Posts
    531

    Re: Get Full Path of selected file

    Dim fiFolder As String = Directory.GetCurrentDirectory

    I can get the current directory. I need to also get the currently selected file... Keep in mind that I am not passing the file into this, it is just selected. If it can know the current directory, why not the first file I have selected?

    Thanks for your reply

  4. #4
    Fanatic Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    518

    Re: Get Full Path of selected file

    How do you select the file?
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,930

    Re: Get Full Path of selected file

    Directory.GetCurrentDirectory just says which directory your application is currently running from (which can change while your program is running), it is not the same as the one your application is located in or was started from, and not one that is 'selected' somewhere.

    You still haven't given a hint as to where the selected file(s) will be (is that somewhere in your program? another one that you have some kind of link to?), so we can't tell you how to detect them.

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