Assuming you are using Terminal Server services and remote desktop, you can check the environment variable CLIENTNAME , to retrieve the name of the client machine, even if some people report it problems with him.
You can get the value with Environment.GetEnvironmentVariable
, for example:
var clientName = Environment.GetEnvironmentVariable("CLIENTNAME");
For an API-based method, check the preferred way to get the client's name from the Terminal Server session showing how to use WMI or the API em> Terminal Services to retrieve the name of the client.
It seems that the Cassia library encapsulates the Terminal Server API. You can get the customer's name with:
TerminalServicesManager().CurrentSession.ClientName
Another operating system thread shows how to retrieve the client name of the current session or the client names of all sessions.