Name

Path

Synopsis

This class provides many shared methods for processing strings representing file paths in a platform-independent manner. The shared properties allow you to inspect the file conventions of the system on which the software is running. The shared methods supply an implementation of the frequently performed path manipulations. ChangeExtension() allows you to change the extension of a file and GetExtension() allows you to retrieve it. Combine() combines two file paths (the second argument cannot contain a UNC or a drive letter). GetTempPath() returns the current system temporary storage folder, and the infinitely cooler GetTempFileName() creates a unique temporary filename, then creates a zero-byte file there. IsPathRooted() checks to see if a path contains a root, which can also be retrieved by calling GetPathRoot().

Public NotInheritable Class Path
                  ' Public Shared Fields
   Public Shared ReadOnly AltDirectorySeparatorChar As Char      // =&H00000002F
   Public Shared ReadOnly DirectorySeparatorChar As Char         // =&H00000005C
   Public Shared ReadOnly InvalidPathChars As Char()             // =System.Char()
   Public Shared ReadOnly PathSeparator As Char                  // =&H00000003B
   Public Shared ReadOnly VolumeSeparatorChar As Char            // =&H00000003A
                  ' Public Shared Methods
   Public Shared Function ChangeExtension(
        ByVal path As String, 
        ByVal extension As String) As String  
   Public Shared Function Combine(ByVal path1 As String, 
        ByVal path2 As String) As String  
   Public Shared Function GetDirectoryName( ByVal path As ...

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.