如何使用HTTP POST在C#代理支持 [英] how to use http post with proxy support in c#

查看:205
本文介绍了如何使用HTTP POST在C#代理支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#和多形式的数据上传方法

how to use http post with proxy support in c# and multipart form data upload method

推荐答案

这篇文章由Brian格林斯蒂德解释你如何能做到这一点。

This post by Brian Grinstead explains how you can do just that.

有关代理支持,你只需要通过代理设置为的HttpWebRequest 。因此,在上面的例子中,你会改变:

For proxy support, you only need to pass a Proxy setting to HttpWebRequest. So, in the above example, you would change:

HttpWebRequest request = WebRequest.Create(postUrl) as HttpWebRequest;

要:

string MyProxyHostString = "192.168.1.200";
int MyProxyPort = 8080;

HttpWebRequest request = WebRequest.Create(postUrl) as HttpWebRequest;
request.Proxy = new WebProxy (MyProxyHostString, MyProxyPort);

这篇关于如何使用HTTP POST在C#代理支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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