Nevron Open Vision Documentation
Nevron.Nov.IO Namespace / NPath Class / GetFileName Method


In This Topic
    GetFileName Method
    In This Topic
    Gets only the file name and the extension of the given path. Also works for directories. For example, if the path is "C:\Documents\MyFile.txt", this method returns "MyFile.txt". If the path it "C:\Documents", this method returns "Documents".
    Syntax
    'Declaration
     
    
    Public Function GetFileName( _
       ByVal path As System.String _
    ) As System.String
    'Usage
     
    
    Dim instance As NPath
    Dim path As System.String
    Dim value As System.String
     
    value = instance.GetFileName(path)
    public System.string GetFileName( 
       System.string path
    )

    Parameters

    path

    Return Value

    The characters after the last directory separator character in path. If the last character of path is a directory or volume separator character, this method returns String.Empty. If path is null, this method returns null.
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

    See Also