Get the client's computer name

后端 未结 8 1276
轮回少年
轮回少年 2020-12-20 23:47

I am getting the client\'s (website user\'s) IP address. Now I\'d like to go one step further by knowing the user\'s computer name. So far, my research has not turned up any

8条回答
  •  無奈伤痛
    2020-12-21 00:45

    The only thing you could do is try to get a DNS name for the client. "Computer Name" is a Windows made-up thing. Just call the built-in function gethostbyaddr() with the client's IP address. However, it won't always (hardly ever) work.

提交回复
热议问题