Folder Information

  • Thread starter Thread starter Misha
  • Start date Start date
M

Misha

I am trying to retrieve the full path of a file in the
directory of the current solution using the FileInfo
class. However, when I examine the FullName property it
contains a reference to the bin directory, such as
F:\FileFolderTest\bin\FileFolderTest\frmFileTest even
though the file is not in the bin directory. The actual
location is F:\FileFolderTest\frmFileTest. Is there a way
to retrieve the actual file path without the bin reference.

Dim fi As FileInfo

fi = New FileInfo("frmFileTest")

'retrieve the full name
txtCurrentFull.Text = fi.FullName

'clean up
fi = Nothing

Misha
 
The path returns the \bin directory because that's where
the executing .EXE is located. Have you thought about
writing a function to trim the \bin?

Good luck.
 
Back
Top