如何从C#web服务客户端的PC名称 [英] How to retrieve PC name of client from C# webservice

查看:149
本文介绍了如何从C#web服务客户端的PC名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个单独的服务器计算机上运行一个C#Web服务。我希望能够使用的Web服务的具体方法时,获取客户端计算机名称。我已在网上搜索和人提到,这将是难以检索客户机名称如果客户端在连接到路由器



更新:如果没有办法绕过路由器的问题,我将如何能够获得客户的信息(EI IP地址,计算机名,...任何东西)


解决方案

  HttpContext.Current.Request.UserHostAddress 
HttpContext.Current.Request.UserHostName


I have a C# web service running on a separate server machine. I would like to be able to retrieve the client machine name when using a specific method on the web service. I have searched online and people have mentioned that this would be difficult to retrieve client machine names if the clients were connected to a router.

Update: If there is no way to get around the router issue, how would I be able to get the client's information (e.i. ip address, machine name, .... anything)

解决方案

HttpContext.Current.Request.UserHostAddress
HttpContext.Current.Request.UserHostName

这篇关于如何从C#web服务客户端的PC名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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