How to uniquely identify a client machine in an ASP.NET application?

I have a server application that runs in a hosted environment, but it creates print jobs on the client's local network (for NAT, the mechanics of this do not matter).

To send a print job to a printer connected to a workstation, I need to identify the workstation. Users move between workstations, so I cannot constantly associate a user with a workstation / printer. The trivial solution is to require the user to identify the machine with which he logs in, for example, by selecting from the list, but the inconvenience and error of the user.

Parameters that I fixed:

  • Host header variables (nothing identifiable sent)
  • Cookies, in support of user choice. This somewhat explains the potential likelihood of a user error, but actually.
  • HTML5 DOM Storage - Not Supported by Client Browser

Any other ideas?

Edit: I have the puttnig option of this particular function (create a print job) in a thick client application. Then the application can be configured and the problem will disappear. But the user interface will suffer from having to switch between the browser and the Windows application.

+3
source share
3 answers

I will not discuss your strange scenario, just answer your question: how to identify the car?

HTTP- . IP-, NAT. MAC-. . , (.. /).

cookie. , , , , , , , cookie .

cookie (, cookie, ...) .

, : (

+7

, , Request.ServerVariables [ "REMOTE_ADDR" ]; , , IP-, /. REMOTE_HOST. -//nat, , , .

HTTPRequest, Request.UserHostAddress. , HTTPContext.Current.Request.UserHostAddress.

, , , , Response.BinaryWrite(), , .

IIS, ASP.NET: http://msdn.microsoft.com/en-us/library/ms524602(v=vs.90).aspx

- , . ​​

0

If REMOTE_ADDR actually works as advertised, have you tried his brother, REMOTE_HOST? If the HOST does not work, but ADDR does, then

RemoteHostOughta = GetHostEntry(Request.ServerVariables("REMOTE_ADDR")).HostName

Unfortunately, there is some setting that I don’t know about, so my IIS gets the IP address of the server (and not the router!) Instead of the remote one when I read REMOTE_ADDR

0
source

Source: https://habr.com/ru/post/1783729/


All Articles