如何在C#中获取clietn os名称 [英] How to get clietn os name in C#

查看:77
本文介绍了如何在C#中获取clietn os名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得连接到路由器的客户端操作系统。



我尝试过的方法:



我不知道代码请帮帮我

I want to get the os of client who are connected to my router .

What I have tried:

I don't know code please help me

推荐答案

尝试查看UserAgent字符串:HttpRequest.UserAgent Property(System.Web) [ ^ ] - 它应该返回操作系统。

在我的情况下它返回:

Try looking at the UserAgent string: HttpRequest.UserAgent Property (System.Web)[^] - it should return the OS.
In my case it returns:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36



其中Windows NT 10.0表示Win10。



但是,它可能取决于浏览器确切返回的内容。


Where Windows NT 10.0 indicates Win10.

However, it may depend on the browser exactly what is returned.






我是假设您正在寻找代码d请尝试以下代码。



Hi,

I am assuming that you are looking code for backend so please try below code.

For OS,use Request.Browser.Platform, and the version is in Request.UserAgent.





请务必标明答案以表示感谢!!



Please make sure to mark the answer to express thanks!!


这篇关于如何在C#中获取clietn os名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆