How To Get Full Path of a File Using VB.NET

This article explains how to Get Full Path of a File. The FileInfo class provides properties to get file name, extension, directory, size and file attributes.
  • 6239

Get Full Path of a File

The FullName property returns just the full path of a file including the file name. The following code snippet returns the full path of a file.

Imports System.IO

Module Module1

    Sub Main()

        Dim fileName As String = "C:\Temp\MaheshTXFI.txt"

        Dim fi As New IO.FileInfo(fileName)

        Dim fullFileName As String = fi.FullName

        Console.WriteLine("File Name: {0}", fullFileName)


    End Sub

End Module


get full path of file.jpg


More Articles

© 2020 DotNetHeaven. All rights reserved.