dcsimg
Results 1 to 5 of 5

Thread: Get Full Path of selected file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2013
    Posts
    207

    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
    551

    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
    Addicted Member
    Join Date
    Mar 2013
    Posts
    207

    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
    Hyperactive Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    466

    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
    40,032

    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
  •  



Featured


Click Here to Expand Forum to Full Width