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;
string goog = "www.google.com"; IPAddress[] addresslist = Dns.GetHostAddresses(goog); foreach (IPAddress theaddress in addresslist) { Console.WriteLine(theaddress.ToString()); }
Request.ServerVariables["REMOTE_ADDR"]
Request.UserHostAddress
Request
ASPX
strIPAddress = Request.ServerVariables("LOCAL_ADDR")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)