怀疑我在asp.net中的C#编码

编程入门 行业动态 更新时间:2024-10-25 20:21:42
本文介绍了怀疑我在asp中的C#编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在我的asp网页上显示系统的IP地址 所以,我写这个编码

I want to show ip address of the system in my asp web page So, i write this coding

<br /> lbl_ip1.Text =HttpContext.Current.Request.UserHostAddress;<br /> lbl_ip2.Text =HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];<br /> lbl_ip3.Text =HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];<br />

但是它应该显示我的IP地址 。 。 请一些人帮我......!

推荐答案

您好Sathishyadhuv, 对于初学者来说应该没问题,让我解释一下关于这些的一点点: UserHostAddress只会尝试获取客户端的主机地址。 REMOTE_ADDR相同 但是在您有 NAT框的情况下可能会出现此问题或代理服务器 如果您必须拥有客户身份(IP)然后你应该考虑使用X.509 如果你想获得一些关于你的情况的具体信息,请提供更多细节 例如 每个人展示什么? 你使用的净星座是什么? 干杯, Edo Hi Sathishyadhuv, That should be ok for starters, let me explain a lill-bit about those: UserHostAddress will simply try to get the host address of the client. Same for REMOTE_ADDR But the problem may occur in situations where you have a NAT box or Proxy Server If you HAVE to have the client identity (IP) then you should consider using X.509 If you want to get some specific info about your situation, please provide more details e.g. What does each one show? What is the net constellation you are using? Cheers, Edo

更多推荐

怀疑我在asp.net中的C#编码

本文发布于:2023-11-14 04:50:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586267.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我在   asp   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!