![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | How to retrieve workstation hostname Please can anyone tell me how to get the hostname of the client workstation from the service. I've been trying to work with System.ServiceModel.OperationContext.Current but I haven't got it yet. Thanks |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to retrieve workstation hostname I'm using anonymous authentication on net.tcp. Is there a way to get the ipaddress or hostname despite this. Logically, the service must have a network address to route the return packets to so ... "Tolu" <tolumania@hotmail.com> wrote in message news:40F1CCB3-7426-4A1D-8C1B-48904BDE2439@microsoft.com... > Please can anyone tell me how to get the hostname of the client > workstation from the service. I've been trying to work with > System.ServiceModel.OperationContext.Current but I haven't got it yet. > > Thanks |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How to retrieve workstation hostname Try if (OperationContext.Current.Channel.RemoteAddress.Uri.IsAbsoluteUri) ret = OperationContext.Current.Channel.RemoteAddress.Uri.AbsoluteUri.ToString(); else ret = OperationContext.Current.Channel.RemoteAddress.Uri.ToString(); Arkady "Tolu" <tolumania@hotmail.com> wrote in message news:0A87EA3C-3319-45C8-85C3-2855D6072CFB@microsoft.com... > I'm using anonymous authentication on net.tcp. Is there a way to get the > ipaddress or hostname despite this. Logically, the service must have a > network address to route the return packets to so ... > > "Tolu" <tolumania@hotmail.com> wrote in message > news:40F1CCB3-7426-4A1D-8C1B-48904BDE2439@microsoft.com... >> Please can anyone tell me how to get the hostname of the client >> workstation from the service. I've been trying to work with >> System.ServiceModel.OperationContext.Current but I haven't got it yet. >> >> Thanks > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: How to retrieve workstation hostname Thanks Arkady, Apparently the RemoteAddress uri is an AnonymousUri so this does not work. After some research, I found out it is not possible to get the client's address. Many people have thrashed MS for this but the official position on MSDN and blogs is that this is necessary to be able to support NAT, firewall, proxies, etc. It seems the only way to get the hostname or IP address is for the client to send it deliberately to the service. Thanks anyway. Perhaps MS would like to do something about this before finalizing ..Net 3.5. |
My System Specs![]() |
| | #5 (permalink) |
| | Re: How to retrieve workstation hostname That work for me as a charm but not with AnonymousUri. The other way to use Native ( windows ) api : GetTcpTable() Arkady "Tolu" <tolumania@hotmail.com> wrote in message news:F0BFAD77-6F2D-4286-AFA6-D67A083EEF0B@microsoft.com... > Thanks Arkady, > > Apparently the RemoteAddress uri is an AnonymousUri so this does not work. > After some research, I found out it is not possible to get the client's > address. Many people have thrashed MS for this but the official position > on MSDN and blogs is that this is necessary to be able to support NAT, > firewall, proxies, etc. It seems the only way to get the hostname or IP > address is for the client to send it deliberately to the service. Thanks > anyway. Perhaps MS would like to do something about this before finalizing > .Net 3.5. > > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Hostname -> IP Address | VB Script | |||
| Extract hostname from distinguished name | PowerShell | |||
| Hostname to IP translation | PowerShell | |||
| Invalid Hostname | Vista networking & sharing | |||
| Getting hostname in Windows Powershell | PowerShell | |||