For traditional web, is there any built-in function to get device information? I wish to get unique information such as device name or device ip
I tried to use server action from Reference as screenshot below but it returns quite useless information such as desktop, tablet or phone.
Hi,
I'm not sure about built-in function, however did you try some forge components such as device-information or get-device-information. It's mobile but it's client actions so I think you can give a try.
Regards,
Khuong
it is unable to get dependencies even it is client actions
What are you trying to achieve? If you are simply trying to detect a returning user then one option is to create a cookie and use that to detect the on next return of the user. There are some actions in httprequesthandler such as getip however in the case of computers behind a firewall or router such as corporate networks you will get the same IP address returned for every machine in the network.
I tried this but as u said in the case of computers behind a firewall or router such as corporate networks you will get the same IP address returned for every machine in the network.
My application is only for internal access so when I use this action return all same ip for every machine.
Is there any other solution?
As I said what are you trying to actually achieve with this info?, why do you need it as there could be alternative ways of doing it such as storing a cookie on the client side.
You could try using javascript to do it at the client side.
javascript - How to get Computer Name and IP address by Jquery or JS - Stack Overflow
How to Get the IP Address in JavaScript (ipdata.co)
I am trying to get device information which is unique so that I can track the log that triggered by which machine. All the link u gave is return my server ip instead of machine ip
As far as I know you are actually not at a level where you're allowed to access the internals of the device Id.
Depending on what you would like to achieve, what you could to is generate a GUID and store it in a local cookie on the browser.That way you could repeatedly access the cookie and use the GUID as your device id. Perhaps superfluent to note; this is not secure enough if you want to authenticate the device by this. Since you'll be using this for local usage only, I think it should work.