Question: I have web service on server! This service is calling from the clients applications!

Now how i can get user name and computer name of clients that using this service, for example if application from Clint1 calling this service i want to get computer name and user name of Clint1?

Many thanks!

Answer: 
You can't reliably, really.

The server variable `REMOTE_HOST` may provide you with it, but in most cases it will be an IP address and it could well be a proxy's IP address. Also - it is something that can be easily spoofed.

Same goes for username (`REMOTE_USER`), unless you use some `WS-Security` mechanism to authenticate the user calling your webservice.
As Wim said, you can't get this information reliably. For a guaranteed Windows network you can retrieve the current authenticated user (to the machine) using the server variable:

```
System.Web.HttpContext.Current.Request.ServerVariables("LOGON_USER")

```

The REMOTE\_HOST variable is supposed to return the machine name, but in most cases (as he said) it will only be an IP address.

Even on a LAN, this is not an advisable security practice. This information can still be spoofed locally providing internal users the capability to masquerade as other users. If it's simply being used for identification (rather than authentication or authorization) it would probably be "good enough". If you maintained a small datatable (or the networking team) that identified each pc to its expected IP address, this information would achieve what you want.