Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Welche Auswertungen bietet mir die Asp.Net Core Wangkanai.Detection?

23.04.2018 (👁3333)

Welche Auswertungen bietet mir die Asp.Net Core Wangkanai.Detection?

 

Aufgabe:

Ich mÜchte in asp.Net Core 2 zur Laufzeit im Server Controller ermitteln, ob der Client-Browser ein Mobile-Device ist, damit die Oberfläche des Rßckgabe-Views vorab angepasst werden kann.

 

Nuget Package

Wangkanai.Detection (kostenlos)

ASP.NET Core Detection service components for identifying details about client device, browser, engine, platform, and crawler.

 

In der startup.cs Datei muss man die Zeile einfĂźgen, im Bereich ConfigureServices(..)

            // Add detection services.

            services.AddDetectionCore()

                .AddDevice();

 

Dann muss man unter der Controller-Klasse nur noch die Using einbinden

using Wangkanai.Detection;

 

Und kann anschliessend direkt aus dem Request heraus den Client auswerten.

            var client_Browser = Request.Browser();

            var client_Device = Request.Device();

            var client_Engine = Request.Engine();

            var client_Platform = Request.Platform();

 

Hier ein Screenshot der Werte, welche man mit Wangkanai Detection ermitteln kann.

 

Auswertung zur Laufzeit

Laut Debugger


Name

Value

Type

◢

client_Browser

{Wangkanai.Detection.Browser}

Wangkanai.Detection.Browser


Bits

0

byte


Feature

null

Wangkanai.Detection.Feature


Maker

null

string


Name

null

string


Type

Generic

Wangkanai.Detection.BrowserType


Version

null

Wangkanai.Detection.IVersion

◢

client_Device

{Wangkanai.Detection.Device}

Wangkanai.Detection.Device


Crawler

false

bool


Type

Desktop

Wangkanai.Detection.DeviceType

◢

client_Engine

{Wangkanai.Detection.Engine}

Wangkanai.Detection.Engine


Maker

null

string


Name

null

string


Type

WebKit

Wangkanai.Detection.EngineType


Version

null

Wangkanai.Detection.IVersion

◢

client_Platform

{Wangkanai.Detection.Platform}

Wangkanai.Detection.Platform


Bits

0

byte


Name

null

string


Type

Windows

Wangkanai.Detection.PlatformType


Version

null

Wangkanai.Detection.IVersion