Sandip Bantawa
Sandip Bantawa

Reputation: 2880

Different OS Version

I have been trying to get version of OS using C#, I get version of Window using Request.UserAgent but what about system such as Linux version, or OS X version, I am able to get the OS Name but not version. And even considering Windows version its pretty much like hard coded like

if (Request.UserAgent.IndexOf("Windows NT 6.3") > 0)
{
    osName = "Window 8.1";
}
else if (Request.UserAgent.IndexOf("Windows NT 6.2") > 0)
{
    osName = "Window 8";
}

This can be solution for now but not for the other versio I guess. My intended solution could be on the server side or client side.

Thank for you help in advance

Upvotes: 0

Views: 201

Answers (1)

Binson Eldhose
Binson Eldhose

Reputation: 749

It is not possible to get exact version of Client OS because user can change the request header object.

But you can try any ua-parser libraries

Check this nuget package may help you lot UAParser 1.0.1

http://www.nuget.org/packages/UAParser/

Upvotes: 1

Related Questions