Get my local ip address in a Citrix session
I have a simple c# windows code in Visual C# 2008 Express Ed, there I want to get my local computers ip address when running a Citrix session. The appl will run on the Citrix server in the users session, not as admin. I have used google to try to find a solution but failed.
Have anyone done this ?
Best regards /Mikael

Lalit MRank #1,186 · 1.5K reputationPosted Dec 9, 2009, 10:02 PM EST
http://www.codeproject.com/KB/winsdk/citrixIP.aspx?msg=2997926
Dipti Shah6 reputationPosted Dec 10, 2009, 3:18 AM EST
String strHostName = DNS.GetHostName (); Console.WriteLine ("Local Machine's Host Name: " + strHostName); IPHostEntry ipEntry = DNS.GetHostByName (strHostName); IPAddress [] addr = ipEntry.AddressList; for (int i = 0; i addr.Length; i++) Console.WriteLine ("IP Address {0}: {1} ", i, addr[i].ToString ());Anwarul Haque150 reputationPosted Dec 11, 2009, 1:14 AM EST
//using System.Net;
string strHostName, strIPAddress = "";
// Getting Ip address of local machine...
// First get the host name of local machine.
strHostName = Dns.GetHostName();
// Then using host name, get the IP address list..
IPHostEntry ipEntry = Dns.GetHostEntry(strHostName);
IPAddress[] addr = ipEntry.AddressList;
for (int i = 0; i < addr.Length; i++)
{
strIPAddress = addr[i].ToString();
break;
}
return strIPAddress;
Mikael7 reputationPosted Dec 11, 2009, 4:53 AM EST
knguyen_03168 reputationPosted Jun 15, 2011, 11:58 AM EDT
Could you please show me the C# code how to do it?
Thanks and Kind Regards,
Khanh
Mikael7 reputationPosted Jun 15, 2011, 1:02 PM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Jun 15, 2011, 1:04 PM EDT
after each line.