Mega Code Archive

 
Categories / VB.Net / File Directory
 

FileInfo DirectoryName Property gets a string representing the directorys full path

Imports System Imports System.IO Public Class DirectoryTest     Public Shared Sub Main()         Dim fileName As String = "C:\TMP\log.txt"         Dim fileInfo As New FileInfo(fileName)         If Not fileInfo.Exists Then             Return         End If                  Console.WriteLine("{0} has a directoryName of {1}", fileName, fileInfo.DirectoryName)     End Sub End Class