Get the device name connected to the serial port

前端 未结 4 867
再見小時候
再見小時候 2021-01-01 18:36

I search how to get the device name of the material connected to the serial port.

I\'ve two different types of material that can connect on it.

First one : a

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-01 19:31

    Class1 UD = new Class1();
    {
    string strUserAgent = Request.UserAgent.ToLower();
            if (strUserAgent != null)
            {
                string Browser = Request.Browser.Browser;
                string a = Request.Browser.MobileDeviceManufacturer;
                string b = Request.Browser.MobileDeviceModel;
                string c = Request.Browser.Platform;
                string d = Request.Browser.Type;
                string e = Request.Browser.Version;
    
                UD.Browser = Browser;
                UD.MobileDeviceModel = b;
                UD.MobileDeviceManufacturer = a; 
                UD.Platform2 = c;
                UD.Type = d;
                UD.Version2 = e; 
    
    
    
    
                if (Request.Browser.IsMobileDevice == true || strUserAgent.Contains("iphone") ||
                         strUserAgent.Contains("blackberry") || strUserAgent.Contains("mobile") ||
                         strUserAgent.Contains("windows ce") || strUserAgent.Contains("opera mini") ||
                         strUserAgent.Contains("palm"))
                {
                    UD.deviceType = "Request from Mobile Device";
                }
                else
                {
                    UD.deviceType = "Request from Computer";
                }
    
            }
    }
    

提交回复
热议问题