如何从到web服务发出请求的客户端的IP地址 [英] How to get the client IP address from the request made to webservice

查看:122
本文介绍了如何从到web服务发出请求的客户端的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个web服务托管在我的IIS ...我需要找出clientIP地址时,客户端直接使用我的服务

I have a webservice hosted in my IIS... I need to find out the clientIP address when the client use my service directly

HTTP://MyIpAddress/MyApplication/MyWebServiceClass.asmx

和是否有可能从客户机读取文件?如果是的话我该怎么办呢?

and is it possible to read file from the client machine? If so how can I do it?

推荐答案

尝试调用

Request.UserHostAddress

的Htt prequest。 UserHostAddress物业

使用关于从客户机访问文件,这将需要通过首先将文件上传到服务器来实现的。

With regards to accessing a file from the client, this would need be achieved by first uploading the file to the server.

检查接下来的文件上传到Web服务:

Checkout the following on uploading files to a web service:

ASMX文件上传

创建一个简单的文件使用.NET

这篇关于如何从到web服务发出请求的客户端的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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