FromExtension

FileType.FromExtension method

Maps the file extension to the file type.

public static FileType FromExtension(string extension)
Parameter Type Description
extension String The file extension (including the period “.”).

Return Value

When the file type is supported returns it, otherwise returns the default Unknown file type.

Exceptions

exception condition
ArgumentException Thrown when extension is null or empty string.

See Also