Windows apps
Collapse the table of content
Expand the table of content

Extension Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets the string representing the extension part of the file.

Namespace:  System.IO
Assembly:  System.IO (in System.IO.dll)

public string Extension { get; }

Property Value

Type: System..::..String
A string containing the FileSystemInfo extension.

The Extension property returns the FileSystemInfo extension, including the period (.). For example, for a file c:\NewFile.txt, this property returns ".txt".

Show:
© 2017 Microsoft