I use the following code on a windows form to allow the user to select a file within a directory
called MY_DIR. I want to get the file path within that directory and convert this to a string.
So I don't want the whole file path. Just the portion that is in MY_DIR.
Dim sFileAndPath As String = ""
Dim sPath As String = ""
Dim sFile As String = ""
.FileName = ""
.InitialDirectory = MY_DIR
sFileAndPath = CStr(.FileName)
sPath = CStr(Path.GetDirectoryName(sFileAndPath))
sFile = CStr(Path.GetFileName(sFileAndPath))