本文整理汇总了C#中Amazon.S3.AmazonS3Config.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# AmazonS3Config.GetType方法的具体用法?C# AmazonS3Config.GetType怎么用?C# AmazonS3Config.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Amazon.S3.AmazonS3Config
的用法示例。
在下文中一共展示了AmazonS3Config.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: S3Wrapper
public S3Wrapper(string awsID, string awsKey, string locationConstraint, string servername, string storageClass, bool useSSL)
{
AmazonS3Config cfg = new AmazonS3Config();
cfg.UseHttp = !useSSL;
cfg.ServiceURL = (useSSL ? "https://" : "http://") + servername;
cfg.UserAgent = "Duplicati v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + " S3 client with AWS SDK v" + cfg.GetType().Assembly.GetName().Version.ToString();
cfg.BufferSize = (int)Duplicati.Library.Utility.Utility.DEFAULT_BUFFER_SIZE;
m_client = new Amazon.S3.AmazonS3Client(awsID, awsKey, cfg);
m_locationConstraint = locationConstraint;
m_storageClass = storageClass;
}
示例2: S3Wrapper
public S3Wrapper(string awsID, string awsKey, string locationConstraint, string servername, bool useRRS, bool useSSL)
{
AmazonS3Config cfg = new AmazonS3Config();
cfg.CommunicationProtocol = useSSL ? Amazon.S3.Model.Protocol.HTTPS : Amazon.S3.Model.Protocol.HTTP;
cfg.ServiceURL = servername;
cfg.UserAgent = "Duplicati v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + " S3 client with AWS SDK v" + cfg.GetType().Assembly.GetName().Version.ToString();
cfg.UseSecureStringForAwsSecretKey = false;
cfg.BufferSize = (int)Duplicati.Library.Utility.Utility.DEFAULT_BUFFER_SIZE;
m_client = new Amazon.S3.AmazonS3Client(awsID, awsKey, cfg);
m_locationConstraint = locationConstraint;
m_useRRS = useRRS;
}
示例3: S3Wrapper
public S3Wrapper(string awsID, string awsKey, string locationConstraint, string servername, string storageClass, bool useSSL, Dictionary<string, string> options)
{
AmazonS3Config cfg = new AmazonS3Config();
cfg.UseHttp = !useSSL;
cfg.ServiceURL = (useSSL ? "https://" : "http://") + servername;
cfg.UserAgent = "Duplicati v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + " S3 client with AWS SDK v" + cfg.GetType().Assembly.GetName().Version.ToString();
cfg.BufferSize = (int)Duplicati.Library.Utility.Utility.DEFAULT_BUFFER_SIZE;
foreach(var opt in options.Keys.Where(x => x.StartsWith("s3-ext-")))
{
var prop = cfg.GetType().GetProperties().Where(x => string.Equals(x.Name, opt.Substring("s3-ext-".Length), StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
if (prop != null && prop.CanWrite)
{
if (prop.PropertyType == typeof(bool))
prop.SetValue(cfg, Library.Utility.Utility.ParseBoolOption(options, opt));
else if (prop.PropertyType.IsEnum)
prop.SetValue(cfg, Enum.Parse(prop.PropertyType, options[opt], true));
else if (prop.PropertyType == typeof(int))
prop.SetValue(cfg, int.Parse(options[opt]));
else if (prop.PropertyType == typeof(long))
prop.SetValue(cfg, long.Parse(options[opt]));
else if (prop.PropertyType == typeof(string))
prop.SetValue(cfg, options[opt]);
}
if (prop == null)
try { Console.Error.WriteLine("Unsupported option: {0}", opt); }
catch { }
}
m_client = new Amazon.S3.AmazonS3Client(awsID, awsKey, cfg);
m_locationConstraint = locationConstraint;
m_storageClass = storageClass;
}