且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用asp.net MVC4检查手机访问者的数量和网站的桌面访问者数量

更新时间:2023-12-02 14:48:10

您必须检测设备,然后根据该结果需要将详细信息记录到数据库表中作为计数或任何事情。



  if (Request.Browser.IsMobileDevice)
{
// 移动用户时数据库日志的代码
}
else {
// 桌面用户的DB日志代码
}







请检查一下了解更多信息。



如何检测请求是否来自我的asp.net MVC中的移动浏览器


Hi All
i am developing one asp.net MVC4 web application want to know how many(count) mobile users visited my web application and how many(Count) desktop/Laptop users visited web application.

Thanks in Advance

Pradeep.

You have to detect the device and then according to that result where need to log that details into db table as a count or what ever.

if (Request.Browser.IsMobileDevice)
            {
                //code for DB log when mobile users
            }
            else {
                //code for DB log when desk top users
            }




Please check this for more info.

How can i detect if the request is coming from a mobile browser in my asp.net MVC