如何使用C#获取远程主机的IP? [英] How can i get the ip of a remote host using c#?

查看:278
本文介绍了如何使用C#获取远程主机的IP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
现在,我正在我的毕业项目中开发一个聊天应用程序,并且遇到一个问题,当我使用来自本地主机的请求发送到远程主机以建立它们之间的通信时,应该认为远程主机从另一个主机(包括发送者的ip地址)获取请求消息,但与此相反,当我从一台计算机向另一台计算机发送请求时,请求消息不在请求源的ip中,但是而是显示接收器的IP地址!

你明白我的意思吗?

如果您向我提出解决方案,我将不胜感激.

Hey all,
Now i am developing a chatting application in my graduation project, and i am facing a problem, when i use a request from the local host to be sent to a remote host in order to establish the communication between them, it is supposed to that the remote host get the request msg form the other host including the ip address of the sender, but here is the opposite, when i send request from one computer to another the request msg is not in the ip of the source of the request, but it displays the ip address of the receiver instead!

Do you get my point?

i would be grateful if you replied me with the solution.

推荐答案

找到了^ ]-在VB.net中,但应该可以转换为C#.
Found this[^] - in VB.net but it should be possible to convert to C#.


这篇关于如何使用C#获取远程主机的IP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆