How to get the machine type of the machine accessing an application on a server using .NET?
I'm trying to do different things in my application based on whether the machine accessing the web based program is a mobile device such 开发者_运维知识库as an Iphone or droid or if it is a desktop or laptop.
Is there a way for me to know if the application is fired off by an iphone or some other mobile device?
You may use the browser capabilities object that comes with HttpRequest object.
Check this article in MSDN:
- https://msdn.microsoft.com/en-us/library/3yekbd5b(v=VS.100).aspx
You can get all the info you need from the Request.Browser object.
Good sample code can be found here: http://msdn.microsoft.com/en-us/library/3yekbd5b.aspx
精彩评论