Last post May 29, 2019 04:37 PM by PatriceSc
May 29, 2019 03:38 PM|hkbeer|LINK
May 29, 2019 03:43 PM|mgebhard|LINK
My asp site does not have login module.
What is the code to get approx identity of the user like client computer name or ip, or any other info about use?
What is the code? Thanks
It is not possible to get the computer name or IP in a web application.. You can get an IP but it will be the client's gateway device IP not the computer's IP.
May 29, 2019 04:04 PM|PatriceSc|LINK
There is no such thing as an "approximate identity". IMO wonder first what you really want to do with the collected information to see if an IP address could be used or if maybe you just need a real login system.
If an IP address can really fit your unknown goal, see https://stackoverflow.com/questions/735350/how-to-get-a-users-client-ip-address-in-asp-net
BTW your web server is already logging basic information about each http request : https://stackify.com/how-to-interpret-iis-logs/
May 29, 2019 04:19 PM|hkbeer|LINK
May 29, 2019 04:37 PM|mgebhard|LINK
Thanks. Most likelyIT Support will put my apps to cloud like AWS or Asure and restrict access to only a few client users. So with only less than 10 users I may simply identitify them with their ip? As most of them are just 1 guy in a particular country.
Again, using the IP address in a web application is not reliable. It is possible to white list IP address but this requires configuration on your side and the client side which is out-of-scope for an ASP.NET forum. Your system admin should be able to
May 29, 2019 04:37 PM|PatriceSc|LINK
If you want to restrict access to known users you need to add a login system. If using Azure it might be done perhaps with something called "easy authentication" (enabled on the web site without any code change, would have to see if you
can filter out users).
As pointed by the ealier link an IP address is unrelated to a user identity and in particular :
- multiple computers in a private network could be exposed to internet using a single IP
- the public IP of a machine could change over time
- multiple users could use the same machine (with the same IP)
- a user may want to use multiple machines (and so have multiple IPs)