I have a wcf service running on LAN server, use tcp/ip mode. Now I need to get every client info when the client send request connect the wcf service. Because it's all on LAN. I just need get the client MAC, IP , PC name. Is there any way to get these info ? thanks.
Asked
Active
Viewed 1,882 times
2 Answers
0
You could try something like this:
var properties = OperationContext.Current.IncomingMessageProperties;
var endpointProperty = properties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
if (endpointProperty != null)
{
var ip = endpointProperty.Address;
}
For more information about OperationContext
class, please have a look here.

Christos
- 53,228
- 8
- 76
- 108
-3
http://msdn.microsoft.com/en-us/library/system.environment.machinename(v=vs.110).aspx for computer name
Get public/external IP address? for ip address
Reliable method to get machine's MAC address in C# for MAC
Please consider googleing before posting a question, I found these answers in 2 minutes.

Community
- 1
- 1

Alex Barac
- 632
- 4
- 12
-
You foolish guy, Please read the question carefully before googling. Somebody requires client details, not server details. – Maitrey684 Nov 29 '16 at 06:26