远程连接的客户端的IP地址..... C# [英] ip address of remote connected client ............C#

查看:67
本文介绍了远程连接的客户端的IP地址..... C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.............
我已经完成了客​​户端服务器应用程序....
但是我无法从服务器端获取已连接客户端的IP .........
并使用接受"和拒绝"按钮.......
plz help.??????????

hi.............
i have done Client server application....
but i am unable to get ip of connected clients .from server side...........
and using Accept and Decline buttons.......
plz help.??????????

推荐答案

尝试这个

首先在CS页面顶部包含此头文件

Try this one

first include this header file in top of cs page

using System.Net;
using System.Web.Security;



然后使用以下功能获取客户端的机器IP地址

Request.UserHostAddress

希望对您有帮助!



Then using below function to get a client mechine ip address

Request.UserHostAddress

Hope This will Help full for you!!


但是我想要Windows应用程序............
but i want for windows application............


这里可能对您有帮助

http://stackoverflow.com/questions/1904160/getting- -ip-address-of-a-remote-socket-endpoint [
This may help you

http://stackoverflow.com/questions/1904160/getting-the-ip-address-of-a-remote-socket-endpoint[^]


这篇关于远程连接的客户端的IP地址..... C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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