how to get the client MAC Address (in ASP.net)
View Complete Post
hi all i use all ways i found on the Net to get client IP address or PC name (client side IP) in asp.net page but always i have server IP
im behind proxy
is there a way to do that and get actual IP and PC of client or visitor of my site - i don't want outer visitor IP i want the employee IP in my LAN
I already read lot of topics about the way to retrieve client IP when used tcp or http bindings. It works well.
But, I don't find any way to get the client IP address when using PollingDuplex...
Usually, the following code works (for http and tcp) :
operationContext = OperationContext.Current;
I'm using the following code to read the ip address and port from a client that connects to my service:
//Read IP-address and port MessageProperties messageProperties = OperationContext.Current.IncomingMessageProperties; RemoteEndpointMessageProperty endpointProperty = messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty; string ip = endpointProperty.Address; string port = endpointProperty.Port.ToString();
If I connect with a wpf client using netTcp binding I can read the proper ip adress and port number but if I connect with a SL4-client with the PollingDuplex the ip adress is empty and the port is 0. Why is that?
Thanks for help!
EDIT: I noticed that it works as supposed for Silverlight 3 so this seems to be SL4 specific.
I have deployed a WCF duplex service on IIS7 that gets the client's IP address and based on that if the IP address repeats, the client is not given access to service. The problem is that when I deploy it on IIS7 and try to access it from another PC on LAN,
it identifies the new PC having the same IP address as the one that the service is deployed in(just for testing purpose, I am returning the retrieved IP address to client), and So, I am not able to access the service from another PC.
Can anyone help me with this?
I used following methodsHttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]Request.ServerVariables["REMOTE_HOST"]Request.UserHostAddressRequest.UserHostName
All the above are returning "127.0.0.1", not the actual IP.
The below one returns null.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]
Below one always returns where the application is hosted/running, not the client's IP address.string strHostName = System.Net.Dns.GetHostName();string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
<?xml version="1.0" encoding="utf-8"?>
I have a WCF web service and clients running on separate windows server 2003 machines. I'm using windows integrated authentication to authenticate the clients. All of the clients and the service are running in appPools in IIS6 as specified active directory users. I have added the service as a service reference to the client project in Visual Studio 2008. This works fine in the development network. To run it in the Production environment I need to change the URL and the UPN at runtime to the production values, but whatever I try it just throws errors? In fact the only thing that worked - but isn't really practical - is when I removed the development service reference and added the production service reference to the project using Visual Studio before deployment. Surely there is some way to change the endpoint at runtime??? I must be missing something simple. Please help! :) Here is the relevant part of the client endpoint:
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ < endpoint address ="http://dev.happyfunland.com.au/FunService.svc" binding ="wsHttpBinding" ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ bindingConfiguration<
I need ur help,what i want to do is to execute a url ("To send a text message to client") on client registration but without showing that url page, in short executing url without displaying any page or url to the client.
please help and thanks in advance.
in my MVC 2 application, and in the shared Master Page I wrote this little script for menu handling :
The script, that shows menu items when the