HttpWeb请求/响应问题
我有一个在 iis(7) 上运行的应用程序(asp.net mvc,如果这很重要的话),我想从 PDA 连接到它(显然是来自控制器的方法)。 我正在使用 HttpWebRequest/Response 但我得到“无法连接到远程服务器”“无法建立连接,因为目标计算机主动拒绝它”
如果我从控制台应用程序做同样的事情(这次客户端和服务器是同一台机器),它工作得很好 怎么解决呢?谢谢。
后来编辑:问题解决了。我刚刚从支架上拔出手机并再次放入,它再次连接到电脑,现在可以使用了
I have an application running on iis(7) ( asp.net mvc if that matters ) and i want to connect to it ( a method from a controller obviously ) from a PDA.
I am using HttpWebRequest/Response but i get "Unable to connect to the remote server" "No connection could be made because the target machine actively refused it"
If i am doing the same thing from a console application ( this time the client and server are the same machine ) it works fine
How to solve it ? Thanks.
Later edit: Problem solved. I just pulled out the mobile from the cradle and put it in again, it connected again to the pc and now it works
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
端口 80 是否对入站请求开放?您可能需要添加规则:
具有高级安全性的 Windows 防火墙/入站规则/新规则/端口规则
IS port 80 open for inbound requests? You may need to add a rule :
Windows Firewall with Advanced Security / Inbound Rules / New Rule / Port Rule
从不在同一台计算机上运行的控制台应用程序尝试一下。这很可能是防火墙问题或类似问题。
或者,根本不使用控制台应用程序 - 只需启动浏览器并点击任何会响应的 URL - 即使它会响应错误。这至少会显示您是否可以访问服务器。
Try it from a console application not running on the same machine. It may well be a firewall issue or something similar.
Alternatively, don't use a console app at all - just fire up a browser and hit any URL which will respond - even if it will respond with an error. That will at least show whether you can reach the server or not.