Question: Simple utility to get a file for use.

Using openfiledialog I am trying to get the full path EG: File = text1.txt and it is located in c:\temp. So the full path is C:\temp\text1.txt.

But all I can get is the file name. I've searched I've hunted, I'e tried for a couple of hours and nothing works.

Here is code with comments...

```
'open the openfile dialog so the user can search for a file
        Dim openFileDialog1 As New OpenFileDialog()
        'set the root to the z drive
        openFileDialog1.InitialDirectory = "Z:\"
        'make sure the root goes back to where the user started
        openFileDialog1.RestoreDirectory = True
        'show the dialog
        openFileDialog1.ShowDialog()

        'check there is something to work with... the user did not exit before selecting a file etc.
        If openFileDialog1.FileName.Length = 0 Then

            'if the user selected a file set the value of the replacefile text box
        Else
            TB_ReplacementFile.Text = System.IO.Path.GetFullPath(openFileDialog1.FileName)

        End If

```

All I get is the file name...

Answer: 
The MSDN documentation and numerous posts all over the place say all you need is openfiledialog.FileName. However this did not work for me, can't tell you why. What DID work is to use this: 

```
TB_ReplacementFile.Text = System.IO.Path.GetFullPath(openFileDialog1.FileName)

```

This works great, I get what I need. I cannot explain why I have to do this. Not sure how I can be the problem, but that must be the problem right?!

Hopefully this helps someone.
The [FileName Property](https://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename(v=vs.110).aspx) returns the full path.

> 
> The file name includes both the file path and the extension. If no files are selected, this method returns an empty string ("").
> 
> 
> 

```
If (openFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK) Then
    TB_ReplacementFile.Text = openFileDialog1.FileName
End If

```