Assume there are two systems; System1 and System2.
- System1 - Windows XP
- System2 - Linux.
I have installed a WPF application on System1. A user on System2 connects to System1 via a Remote Desktop Connection and launches the WPF application.
In the WPF application, I can get the local IP address and Windows Login Name for System1 using the following code.
private String GetIP()
{
string strHostName = "";
strHostName = System.Net.Dns.GetHostName();
IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);
IPAddress[] addr = ipEntry.AddressList;
return addr[0].ToString();
}
String WinUserName_withNetwork = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
String WinUserNameOnly = System.Environment.UserName;
My problem is I want the IP address and user name of the user logging in from System2.
What do I need to do in order to get that IP address and user name?