![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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 | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SMTP need fully qualified hostname | David | Vista mail | 0 | 03-26-2008 05:07 AM |
| Extract hostname from distinguished name | cmyers | PowerShell | 11 | 02-07-2008 08:44 AM |
| Hostname to IP translation | Joe Freedom | PowerShell | 14 | 12-12-2007 09:47 AM |
| Invalid Hostname | Oscette | Vista networking & sharing | 0 | 01-28-2007 01:34 AM |
| Getting hostname in Windows Powershell | =?Utf-8?B?YnJhdG8=?= | PowerShell | 4 | 08-14-2006 04:16 PM |