本文整理汇总了C#中Amazon.S3.AmazonS3Config.SetWebProxy方法的典型用法代码示例。如果您正苦于以下问题:C# AmazonS3Config.SetWebProxy方法的具体用法?C# AmazonS3Config.SetWebProxy怎么用?C# AmazonS3Config.SetWebProxy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Amazon.S3.AmazonS3Config
的用法示例。
在下文中一共展示了AmazonS3Config.SetWebProxy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HostPortPrecedenceSetting
//[Fact]
public void HostPortPrecedenceSetting()
{
var customProxy = new WebProxy("http://localhost:8889/");
var config = new AmazonS3Config();
config.SetWebProxy(customProxy);
config.ProxyHost = "127.0.0.1";
config.ProxyPort = 8888;
config.ProxyCredentials = new NetworkCredential("1", "1");
config.RegionEndpoint = RegionEndpoint.USEast1;
var setProxy = new WebProxy(config.ProxyHost, config.ProxyPort);
config.SetWebProxy(setProxy);
var c = config.GetWebProxy();
Assert.Equal(setProxy, config.GetWebProxy());
}
示例2: CreateClientUsingProxy
//[Fact]
public void CreateClientUsingProxy()
{
var config = new AmazonS3Config
{
ProxyCredentials = new NetworkCredential("1", "1"),
RegionEndpoint = RegionEndpoint.USEast1
};
config.SetWebProxy(new WebProxy("http://localhost:8888/"));
client = new AmazonS3Client(config);
ListBuckets();
}
示例3: WebProxyPrecedenceSetting
//Fact]
public void WebProxyPrecedenceSetting()
{
var config = new AmazonS3Config
{
ProxyHost = "127.0.0.1",
ProxyPort = 0,
ProxyCredentials = new NetworkCredential("1", "1"),
RegionEndpoint = RegionEndpoint.USEast1,
UseHttp = true
};
var customProxy = new WebProxy("http://localhost:8888/");
config.SetWebProxy(customProxy);
Assert.Equal(customProxy, config.GetWebProxy());
}