클라이언트 IP 추출
using System.Net; using System.Net.Sockets;/// /// 사용자IP 조회 /// /// public string GetRemoteIP() { // IPv6 형태를 IPv4 형태로 string ip = string.Empty; try { foreach (IPAddress i in Dns.GetHostAddresses(HttpContext.Current.Request.UserHostAddress)) { if (i.AddressFamily == AddressFamily.InterNetwork) { ip = i.ToString(); break; } } if (ip == string.Empty) { foreach (IPAddress i in Dns.GetHostAddresses(..
C#
2019. 1. 15. 09:21