Meziantou.Framework.Win32.PerceivedType
2.0.15
Prefix Reserved
dotnet add package Meziantou.Framework.Win32.PerceivedType --version 2.0.15
NuGet\Install-Package Meziantou.Framework.Win32.PerceivedType -Version 2.0.15
<PackageReference Include="Meziantou.Framework.Win32.PerceivedType" Version="2.0.15" />
<PackageVersion Include="Meziantou.Framework.Win32.PerceivedType" Version="2.0.15" />
<PackageReference Include="Meziantou.Framework.Win32.PerceivedType" />
paket add Meziantou.Framework.Win32.PerceivedType --version 2.0.15
#r "nuget: Meziantou.Framework.Win32.PerceivedType, 2.0.15"
#:package Meziantou.Framework.Win32.PerceivedType@2.0.15
#addin nuget:?package=Meziantou.Framework.Win32.PerceivedType&version=2.0.15
#tool nuget:?package=Meziantou.Framework.Win32.PerceivedType&version=2.0.15
Meziantou.Framework.Win32.PerceivedType
A .NET library for determining a file's perceived type based on its extension using Windows APIs.
Usage
This library provides functionality to get a file's perceived type (text, image, audio, video, etc.) based on its extension by querying the Windows registry and using the AssocGetPerceivedType Win32 API.
Get Perceived Type
using Meziantou.Framework.Win32;
// Get perceived type for a file extension
var perceived = Perceived.GetPerceivedType(".txt");
Console.WriteLine(perceived.PerceivedType); // Text
Console.WriteLine(perceived.PerceivedTypeSource); // SoftCoded or HardCoded
// Works with various file types
var image = Perceived.GetPerceivedType(".jpg");
Console.WriteLine(image.PerceivedType); // Image
var video = Perceived.GetPerceivedType(".mp4");
Console.WriteLine(video.PerceivedType); // Video
var audio = Perceived.GetPerceivedType(".mp3");
Console.WriteLine(audio.PerceivedType); // Audio
Add Custom Perceived Types
You can add custom perceived types or override system-defined types:
// Add a custom perceived type
Perceived.AddPerceived(".myext", PerceivedType.Text);
// Add default perceived types for common extensions
Perceived.AddDefaultPerceivedTypes();
Perceived Types
The library supports the following perceived types:
Text- Text files (.txt, .cs, .html, .xml, etc.)Image- Image files (.jpg, .png, .gif, etc.)Audio- Audio files (.mp3, .wav, etc.)Video- Video files (.mp4, .avi, .mpeg, etc.)Compressed- Compressed files (.zip, .rar, etc.)Document- Document files (.doc, .pdf, etc.)Application- Application files (.exe, .dll, etc.)System- System filesGameMedia- Game media filesContacts- Contact filesCustom- Custom type defined in registryUnspecified- No perceived typeUnknown- Unknown type
Perceived Type Source
The PerceivedTypeSource enum indicates where the perceived type information comes from:
Undefined- No perceived type was foundSoftCoded- Determined through registry associationHardCoded- Inherently known to the OSNativeSupport- Determined through OS codecGdiPlus- Supported by GDI+WmSdk- Supported by Windows Media SDKZipFolder- Supported by Windows compressed foldersMime- Determined through MIME content types
Platform Support
This library is Windows-only and requires Windows XP or later (Windows 5.1.2600+).
Additional Resources
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.15 | 0 | 11/30/2025 |
| 2.0.14 | 128 | 11/23/2025 |
| 2.0.13 | 120 | 11/16/2025 |
| 2.0.12 | 132 | 11/9/2025 |
| 2.0.11 | 126 | 11/2/2025 |
| 2.0.10 | 175 | 10/27/2025 |
| 2.0.9 | 130 | 10/26/2025 |
| 2.0.8 | 107 | 10/19/2025 |
| 2.0.7 | 309 | 9/16/2025 |
| 2.0.6 | 201 | 9/3/2025 |
| 2.0.5 | 161 | 3/1/2025 |
| 2.0.4 | 144 | 11/17/2024 |
| 2.0.3 | 320 | 11/15/2023 |
| 2.0.2 | 551 | 7/14/2021 |
| 2.0.1 | 491 | 4/22/2021 |
| 2.0.0 | 580 | 9/24/2020 |
| 1.1.4 | 631 | 6/25/2020 |
| 1.1.3 | 680 | 10/23/2019 |
| 1.1.2 | 855 | 12/12/2018 |
| 1.1.1 | 942 | 10/21/2018 |
| 1.1.0 | 1,126 | 8/7/2018 |
| 1.0.0 | 1,194 | 9/10/2017 |