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)

        Console.ReadLine()

    End Sub

End Module

Output:

get full path of file.jpg

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.