Path.GetExtension : Path « System.IO « VB.Net by API






Path.GetExtension

  

Imports System.IO

Module Module1

    Sub Main()
        Dim P As String = "\"
        Try
            Console.WriteLine("Starting path: {0}", P)
            Console.WriteLine("Directory name: {0}", Path.GetDirectoryName(P))
            Console.WriteLine("Extension: {0}", Path.GetExtension(P))
            Console.WriteLine("Filename: {0}", Path.GetFileName(P))
            Console.WriteLine("Filename without extension: {0}", Path.GetFileNameWithoutExtension(P))
            Console.WriteLine("Full path: {0}", Path.GetFullPath(P))
            Console.WriteLine("Root: {0}", Path.GetPathRoot(P))
        Catch E As Exception
            Console.WriteLine("Error: {0}", E.Message)
        End Try
        Console.WriteLine()
    End Sub

End Module

   
    
  








Related examples in the same category

1.Path.AltDirectorySeparatorChar
2.Path.DirectorySeparatorChar
3.Path.GetDirectoryName
4.Path.GetFileName
5.Path.GetFileNameWithoutExtension
6.Path.GetFullPath
7.Path.GetInvalidFileNameChars()
8.Path.GetInvalidPathChars
9.Path.GetPathRoot
10.Path.VolumeSeparatorChar