MimeTypeFromFileName(ReadOnlySpanChar) Method
Creates an appropriate
MimeType instance for a given
file name.
Namespace: FolkerKinzel.MimeTypesAssembly: FolkerKinzel.MimeTypes (in FolkerKinzel.MimeTypes.dll) Version: 5.6.0+6976b8f96f59170e54fb7f8a4989b77d09f9b1c0
public static MimeType FromFileName(
ReadOnlySpan<char> fileName
)
Public Shared Function FromFileName (
fileName As ReadOnlySpan(Of Char)
) As MimeType
public:
static MimeType^ FromFileName(
ReadOnlySpan<wchar_t> fileName
)
static member FromFileName :
fileName : ReadOnlySpan<char> -> MimeType
- fileName ReadOnlySpanChar
- A file path, file name, file type extension (no matter whether with or without
the period "."), or null.
MimeTypeAn appropriate
MimeType instance for
fileName.
Internally a small memory cache is used to find often used file type extensions faster. You
can enlarge the size of this cache with
MimeCache.EnlargeCapacity(int) or you can delete it
with
MimeCache.Clear() if your application does not need it anymore.