using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; namespace EMIS.Utility { public class ApplicationClientHelper { public static string GetIP() { if (HttpContext.Current != null) { return HttpContext.Current.Request.UserHostAddress; } else { System.Net.IPHostEntry myEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); return myEntry.AddressList[0].ToString(); } } } }