Kayıtlar

Siteye Giren Kullanıcının IP sini Tespit Etmek etiketine sahip yayınlar gösteriliyor

Siteye Giren Kullanıcının IP sini Tespit Etmek

Selamlar Bugün sitemize giren kullanıcıların IP sini nasıl görüceğiz, onu işleyeceğim. Öncelikle Projemize IP adında bir tane class ekleyelim sonrada içerisine aşağıdaki kodları ekleyelim. public string IPA () { string ipal = "" ; if ( HttpContext . Current . Request . ServerVariables [ "HTTP_X_FORWARDED_FOR" ] != null ) { ipal = HttpContext . Current . Request . ServerVariables [ "HTTP_X_FORWARDED_FOR" ]; if (! string . IsNullOrEmpty ( ipal )) { string [] ipRange = ipal . Split ( "," . ToCharArray ()); ipal = ipRange [0]; } } if ( string . IsNullOrEmpty ( ipal )) if ( HttpContext . Current . Request . ServerVariables [ "REMOTE_ADDR" ] != null ) ipal = HttpContext . Current . Request . ServerVariables [ "REMOTE_ADDR" ]. ToString ();