MVC Dış ip adres öğrenme_ServerVariables
<div style="-webkit-text-stroke-width:0px; margin-bottom:11px; text-align:start; text-indent:0px"><span style="font-size:14.6667px"><span style="color:#444444"><span style="font-family:sans-serif"><span style="background-color:#ffffff"><strong><u><span style="font-size:10pt"><span style="font-family:arial,"sans-serif"">ASP.Net'te Ziyaretçi Makinesinin IP Adresi Nasıl Alınır?</span></span></u></strong></span></span></span></span></div> <div style="-webkit-text-stroke-width:0px; margin-bottom:11px; text-align:start; text-indent:0px"><span style="font-size:14.6667px"><span style="color:#444444"><span style="font-family:sans-serif"><span style="background-color:#ffffff"><span style="font-size:10pt"><span style="font-family:arial,"sans-serif"">Yönlendiriciler veya Proxy Sunucular arkasındaki İstemci makineler için öncelikle IP Adresi belirlenir ve bu nedenle </span></span><strong><span style="font-size:10pt"><span style="font-family:arial,"sans-serif""><span style="color:black">HTTP_X_FORWARDED_FOR</span></span></span></strong><span style="font-size:10pt"><span style="font-family:arial,"sans-serif""><span style="color:black"> sunucu </span></span></span><span style="font-size:10pt"><span style="font-family:arial,"sans-serif"">değişkeni kontrol edilir.</span></span></span></span></span></span></div> <div class="note-box" style="-webkit-text-stroke-width:0px; border-color:#fcd209; border-image:initial; border-style:solid; border-width:0px 0px 0px 5px; padding:10px; text-align:start; text-indent:0px"> <div class="col-xs-2 icon pull-left" style="margin-right:10px; max-width:40px; padding:0px 10px; width:40px"> </div> <div class="col-xs-10 pull-left right-content" style="margin-left:-50px; padding-left:60px; padding-right:15px; text-align:left; width:1366px"> <div><span style="font-size:14.6667px"><span style="background-color:#ffffc1"><span style="color:#444444"><span style="font-family:sans-serif"><strong><span style="font-size:11pt !important"><span style="font-family:inherit">Not</span></span></strong><span style="font-size:11pt !important"><span style="font-family:inherit"> : </span></span><span style="font-size:11pt !important"><span style="font-family:inherit">İstemci makinesi bir Proxy Sunucusunun arkasındayken, Proxy Sunucusunun IP Adresi İstemci makinesinin IP Adresine eklenir. Birden fazla Proxy Sunucusu varsa, tüm Proxy Sunucularının IP Adresleri, istemci makine IP Adresine eklenir.</span></span></span></span></span></span></div> </div> </div> <div style="-webkit-text-stroke-width:0px; text-align:start; text-indent:0px"><span style="font-size:14.6667px"><span style="color:#444444"><span style="font-family:sans-serif"><span style="background-color:#ffffff"> </span></span></span></span></div> <div style="-webkit-text-stroke-width:0px; margin-bottom:11px; text-align:start; text-indent:0px"><span style="font-size:14.6667px"><span style="color:#444444"><span style="font-family:sans-serif"><span style="background-color:#ffffff"><span style="font-size:10pt"><span style="font-family:arial,"sans-serif"">IP Adresi <strong><span style="font-size:11pt !important"><span style="font-family:inherit"><span style="color:black">HTTP_X_FORWARDED_FOR</span></span></span></strong> sunucu değişkeninde bulunamazsa, herhangi bir Proxy Sunucusu kullanmadığı anlamına gelir ve bu nedenle IP Adresi artık <strong>REMOTE_ADDR</strong> sunucu değişkeninde kontrol edilir.</span></span></span></span></span></span></div> <div style="-webkit-text-stroke-width:0px; margin-bottom:13px; text-align:start; text-indent:0px"><span style="font-size:14.6667px"><span style="color:#444444"><span style="font-family:sans-serif"><span style="background-color:#ffffff"><strong><span style="font-size:10pt"><span style="font-family:arial,"sans-serif"">C#</span></span></strong></span></span></span></span></div> <div class="code_block" style="-webkit-text-stroke-width:0px; border:1px solid #e1e1e8; padding:5px; text-align:start; text-indent:0px"> <div><span style="font-size:14.6667px"><span style="background-color:#f5f2f0 !important"><span style="color:#444444"><span style="font-family:sans-serif"><span style="font-size:10pt !important"><span style="font-family:"Courier New" !important"><span style="font-size:9.5pt"><span style="font-family:"courier new""><span style="color:blue">dize </span></span></span><span style="font-size:9.5pt"><span style="font-family:"courier new"">ipadresi;</span></span></span></span></span></span></span></span></div> <div><span style="font-size:14.6667px"><span style="background-color:#f5f2f0 !important"><span style="color:#444444"><span style="font-family:sans-serif"><span style="font-size:10pt !important"><span style="font-family:"Courier New" !important"><span style="font-size:9.5pt"><span style="font-family:"courier new"">ipaddress = Request.ServerVariables[ <span style="font-size:11pt !important"><span style="font-family:inherit"><span style="color:maroon">"HTTP_X_FORWARDED_FOR"</span></span></span> ];</span></span></span></span></span></span></span></span></div> <div><span style="font-size:14.6667px"><span style="background-color:#f5f2f0 !important"><span style="color:#444444"><span style="font-family:sans-serif"><span style="font-size:10pt !important"><span style="font-family:"Courier New" !important"><span style="font-size:9.5pt"><span style="font-family:"courier new""><span style="color:blue">if </span></span></span><span style="font-size:9.5pt"><span style="font-family:"courier new"">(ipadresi == <span style="font-size:11pt !important"><span style="font-family:inherit"><span style="color:maroon">""</span></span></span> || ipadresi == <span style="font-size:11pt !important"><span style="font-family:inherit"><span style="color:blue">null</span></span></span> )</span></span></span></span></span></span></span></span></div> <div><span style="font-size:14.6667px"><span style="background-color:#f5f2f0 !important"><span style="color:#444444"><span style="font-family:sans-serif"><span style="font-size:10pt !important"><span style="font-family:"Courier New" !important"><span style="font-size:9.5pt"><span style="font-family:"courier new""> ipaddress = Request.ServerVariables[ <span style="font-size:11pt !important"><span style="font-family:inherit"><span style="color:maroon">"REMOTE_ADDR"</span></span></span> ];</span></span></span></span></span></span></span></span></div> </div>
0 Yorum