Cüneyt Kocabıyık

Asp.Net İp Adresi Alma

Asp.Net İp Adresi Alma

                        var ip = string.Empty;

                        if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
                            ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
                        else if (HttpContext.Current.Request.ServerVariables["HTTP_CLIENT_IP"] != null && HttpContext.Current.Request.ServerVariables["HTTP_CLIENT_IP"].Length != 0)
                            ip = HttpContext.Current.Request.ServerVariables["HTTP_CLIENT_IP"];
                        else if (HttpContext.Current.Request.UserHostAddress.Length != 0)
                            ip = HttpContext.Current.Request.UserHostName;
                        string url = HttpContext.Current.Request.RawUrl;



süleyman ÇAKMAK

harikasın cüneyt bey