How to get Client's computer name from WCF asmx C#?
I have tried this way but it doesn't work at all.
This is a best solution that I've thought of but it doesn't work ... okay the result is to return the Client's computer name but sometimes it returns Computer name A and sometimes it's Computer name B.
string[] computer_name = System.Net.Dns.GetHostEntry( HttpContext.Current.Request.ServerVariables["remote_addr"]) .HostName.Split(new Char[] { '.' }); logData.ComputerName = computer_name[0].ToString();
The result is Computer name from WCF not Client.
System.Environment.MachineName
The same result as 1 but returns
Empty
sometime.System.Net.Dns.GetHostByName("LocalHost").HostName.
Returns
Null
.OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name
Return IP,IP and Client's user
loginRequest.ServerVariables["remote_addr"], Request.ServerVariables["remote_host"], Request.ServerVariables["remote_user"]