Sang.UAParser
1.0.5
dotnet add package Sang.UAParser --version 1.0.5
NuGet\Install-Package Sang.UAParser -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sang.UAParser" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sang.UAParser --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sang.UAParser, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Sang.UAParser as a Cake Addin #addin nuget:?package=Sang.UAParser&version=1.0.5 // Install Sang.UAParser as a Cake Tool #tool nuget:?package=Sang.UAParser&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sang.UAParser
A simple user agent parser for .NET.
Installation
dotnet add package Sang.UAParser
Usage
using Sang.UAParser;
var uaParser = new UAParser();
var ua = uaParser.Parse("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3");
Console.WriteLine(ua.Browser); // Chrome
Console.WriteLine(ua.BrowserVersion); // 58.0.3029.110
Console.WriteLine(ua.OS); // Windows
Console.WriteLine(ua.OSVersion); // 10
Console.WriteLine(ua.DeviceType); // Desktop
Parsing Types
Sang.UAParser supports parsing the following types of information from a user agent string:
- Browser: The web browser that the user agent is using, such as Chrome, Firefox, Safari, etc.
- Browser Version: The version of the web browser.
- OS: The operating system that the user agent is running on, such as Windows, macOS, Linux, etc.
- OS Version: The version of the operating system.
- Device Type: The type of device that the user agent is running on. This can be one of the following: Desktop, Mobile, Spider, Bot, Other.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- No dependencies.
-
net8.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.