本文整理汇总了C#中StorageUri类的典型用法代码示例。如果您正苦于以下问题:C# StorageUri类的具体用法?C# StorageUri怎么用?C# StorageUri使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StorageUri类属于命名空间,在下文中一共展示了StorageUri类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CloudFileDirectory
public CloudFileDirectory(StorageUri directoryAbsoluteUri, StorageCredentials credentials)
#endif
{
this.Metadata = new Dictionary<string, string>();
this.Properties = new FileDirectoryProperties();
this.ParseQueryAndVerify(directoryAbsoluteUri, credentials);
}
开发者ID:benaadams,项目名称:azure-storage-net,代码行数:7,代码来源:CloudFileDirectory.Common.cs
示例2: CloudQueue
public CloudQueue(StorageUri queueAddress, StorageCredentials credentials)
#endif
{
this.ParseQueryAndVerify(queueAddress, credentials);
this.Metadata = new Dictionary<string, string>();
this.EncodeMessage = true;
}
开发者ID:benaadams,项目名称:azure-storage-net,代码行数:7,代码来源:CloudQueue.Common.cs
示例3: CloudAnalyticsClient
/// <summary>
/// Initializes a new instance of the <see cref="CloudAnalyticsClient"/> class using the specified Blob and Table service endpoints
/// and account credentials.
/// </summary>
/// <param name="blobStorageUri">A <see cref="StorageUri"/> object containing the Blob service endpoint to use to create the client.</param>
/// <param name="tableStorageUri">A <see cref="StorageUri"/> object containing the Table service endpoint to use to create the client.</param>
/// <param name="credentials">A <see cref="StorageCredentials"/> object.</param>
public CloudAnalyticsClient(StorageUri blobStorageUri, StorageUri tableStorageUri, StorageCredentials credentials)
{
CommonUtility.AssertNotNull("blobStorageUri", blobStorageUri);
CommonUtility.AssertNotNull("tableStorageUri", tableStorageUri);
this.blobClient = new CloudBlobClient(blobStorageUri, credentials);
this.tableClient = new CloudTableClient(tableStorageUri, credentials);
this.LogContainer = Constants.AnalyticsConstants.LogsContainer;
}
开发者ID:jianghaolu,项目名称:azure-storage-net,代码行数:16,代码来源:CloudAnalyticsClient.cs
示例4: CloudFileShare
/// <summary>
/// Initializes a new instance of the <see cref="CloudFileShare"/> class.
/// </summary>
/// <param name="shareAddress">The absolute URI to the share.</param>
/// <param name="credentials">A <see cref="StorageCredentials"/> object.</param>
public CloudFileShare(StorageUri shareAddress, StorageCredentials credentials)
{
CommonUtility.AssertNotNull("shareAddress", shareAddress);
CommonUtility.AssertNotNull("shareAddress", shareAddress.PrimaryUri);
this.ParseQueryAndVerify(shareAddress, credentials);
this.Metadata = new Dictionary<string, string>();
this.Properties = new FileShareProperties();
}
开发者ID:tamram,项目名称:azure-storage-net,代码行数:14,代码来源:CloudFileShare.Common.cs
示例5: CloudBlobContainer
/// <summary>
/// Initializes a new instance of the <see cref="CloudBlobContainer"/> class.
/// </summary>
/// <param name="containerAddress">A <see cref="System.Uri"/> object specifying the absolute URI to the container.</param>
/// <param name="credentials">A <see cref="StorageCredentials"/> object.</param>
public CloudBlobContainer(StorageUri containerAddress, StorageCredentials credentials)
{
CommonUtility.AssertNotNull("containerAddress", containerAddress);
CommonUtility.AssertNotNull("containerAddress", containerAddress.PrimaryUri);
this.ParseQueryAndVerify(containerAddress, credentials);
this.Metadata = new Dictionary<string, string>();
this.Properties = new BlobContainerProperties();
}
开发者ID:tamram,项目名称:azure-storage-net,代码行数:14,代码来源:CloudBlobContainer.Common.cs
示例6: CloudBlob
/// <summary>
/// Initializes a new instance of the <see cref="CloudBlob"/> class using an absolute URI to the blob.
/// </summary>
/// <param name="blobAbsoluteUri">A <see cref="StorageUri"/> containing the absolute URI to the blob at both the primary and secondary locations.</param>
/// <param name="snapshotTime">A <see cref="DateTimeOffset"/> specifying the snapshot timestamp, if the blob is a snapshot.</param>
/// <param name="credentials">A <see cref="StorageCredentials"/> object.</param>
/// <returns>A <see cref="CloudBlob"/> object.</returns>
public CloudBlob(StorageUri blobAbsoluteUri, DateTimeOffset? snapshotTime, StorageCredentials credentials)
{
CommonUtility.AssertNotNull("blobAbsoluteUri", blobAbsoluteUri);
CommonUtility.AssertNotNull("blobAbsoluteUri", blobAbsoluteUri.PrimaryUri);
this.attributes = new BlobAttributes();
this.SnapshotTime = snapshotTime;
this.ParseQueryAndVerify(blobAbsoluteUri, credentials);
this.Properties.BlobType = BlobType.Unspecified;
}
开发者ID:pemari-msft,项目名称:azure-storage-net,代码行数:17,代码来源:CloudBlob.Common.cs
示例7: CloudQueueClient
public CloudQueueClient(StorageUri storageUri, StorageCredentials credentials)
#endif
{
this.StorageUri = storageUri;
this.Credentials = credentials ?? new StorageCredentials();
this.DefaultRequestOptions = new QueueRequestOptions();
this.DefaultRequestOptions.RetryPolicy = new ExponentialRetry();
this.DefaultRequestOptions.LocationMode = RetryPolicies.LocationMode.PrimaryOnly;
this.AuthenticationScheme = AuthenticationScheme.SharedKey;
this.UsePathStyleUris = CommonUtility.UsePathStyleAddressing(this.BaseUri);
}
开发者ID:DaC24,项目名称:azure-storage-net,代码行数:11,代码来源:CloudQueueClient.Common.cs
示例8: CloudQueueClient
public CloudQueueClient(StorageUri storageUri, StorageCredentials credentials)
#endif
{
this.StorageUri = storageUri;
this.Credentials = credentials ?? new StorageCredentials();
this.RetryPolicy = new ExponentialRetry();
this.LocationMode = LocationMode.PrimaryOnly;
this.ServerTimeout = Constants.DefaultServerSideTimeout;
this.AuthenticationScheme = AuthenticationScheme.SharedKey;
this.UsePathStyleUris = CommonUtility.UsePathStyleAddressing(this.BaseUri);
}
开发者ID:BurtHarris,项目名称:azure-storage-net,代码行数:11,代码来源:CloudQueueClient.Common.cs
示例9: CloudBlobDirectory
/// <summary>
/// Initializes a new instance of the <see cref="CloudBlobDirectory"/> class given an address and a client.
/// </summary>
/// <param name="uri">The blob directory's Uri.</param>
/// <param name="prefix">The blob directory's prefix.</param>
/// <param name="container">The container for the virtual directory.</param>
internal CloudBlobDirectory(StorageUri uri, string prefix, CloudBlobContainer container)
{
CommonUtility.AssertNotNull("uri", uri);
CommonUtility.AssertNotNull("prefix", prefix);
CommonUtility.AssertNotNull("container", container);
this.ServiceClient = container.ServiceClient;
this.Container = container;
this.Prefix = prefix;
this.StorageUri = uri;
}
开发者ID:benaadams,项目名称:azure-storage-net,代码行数:17,代码来源:CloudBlobDirectory.Common.cs
示例10: CloudFile
/// <summary>
/// Initializes a new instance of the <see cref="CloudFile"/> class using the specified file name and
/// the parent share reference.
/// </summary>
/// <param name="uri">The file's Uri.</param>
/// <param name="fileName">Name of the file.</param>
/// <param name="share">The reference to the parent share.</param>
internal CloudFile(StorageUri uri, string fileName, CloudFileShare share)
{
CommonUtility.AssertNotNull("uri", uri);
CommonUtility.AssertNotNullOrEmpty("fileName", fileName);
CommonUtility.AssertNotNull("share", share);
this.attributes = new CloudFileAttributes();
this.attributes.StorageUri = uri;
this.ServiceClient = share.ServiceClient;
this.share = share;
this.Name = fileName;
}
开发者ID:DaC24,项目名称:azure-storage-net,代码行数:19,代码来源:CloudFile.Common.cs
示例11: CloudFileDirectory
/// <summary>
/// Initializes a new instance of the <see cref="CloudFileDirectory"/> class given an address and a client.
/// </summary>
/// <param name="uri">The file directory's Uri.</param>
/// <param name="directoryName">Name of the directory.</param>
/// <param name="share">The share for the directory.</param>
internal CloudFileDirectory(StorageUri uri, string directoryName, CloudFileShare share)
{
CommonUtility.AssertNotNull("uri", uri);
CommonUtility.AssertNotNull("directoryName", directoryName);
CommonUtility.AssertNotNull("share", share);
this.Properties = new FileDirectoryProperties();
this.StorageUri = uri;
this.ServiceClient = share.ServiceClient;
this.share = share;
this.Name = directoryName;
}
开发者ID:vinaysh-msft,项目名称:azure-storage-net,代码行数:18,代码来源:CloudFileDirectory.Common.cs
示例12: CloudFileClient
/// <summary>
/// Initializes a new instance of the <see cref="CloudFileClient"/> class using the specified File service endpoint
/// and account credentials.
/// </summary>
/// <param name="storageUri">The File service endpoint to use to create the client.</param>
/// <param name="credentials">A <see cref="StorageCredentials"/> object.</param>
public CloudFileClient(StorageUri storageUri, StorageCredentials credentials)
{
this.StorageUri = storageUri;
this.Credentials = credentials ?? new StorageCredentials();
this.DefaultRequestOptions =
new FileRequestOptions()
{
RetryPolicy = new ExponentialRetry(),
LocationMode = FileRequestOptions.BaseDefaultRequestOptions.LocationMode,
ParallelOperationThreadCount = FileRequestOptions.BaseDefaultRequestOptions.ParallelOperationThreadCount
};
this.AuthenticationScheme = AuthenticationScheme.SharedKey;
this.UsePathStyleUris = CommonUtility.UsePathStyleAddressing(this.BaseUri);
}
开发者ID:tamram,项目名称:azure-storage-net,代码行数:20,代码来源:CloudFileClient.Common.cs
示例13: CloudBlobClient
public CloudBlobClient(StorageUri storageUri, StorageCredentials credentials)
#endif
{
this.StorageUri = storageUri;
this.Credentials = credentials ?? new StorageCredentials();
this.DefaultRequestOptions = new BlobRequestOptions();
this.DefaultRequestOptions.RetryPolicy = new ExponentialRetry();
this.DefaultRequestOptions.LocationMode = RetryPolicies.LocationMode.PrimaryOnly;
this.DefaultRequestOptions.SingleBlobUploadThresholdInBytes = Constants.MaxSingleUploadBlobSize / 2;
this.DefaultRequestOptions.ParallelOperationThreadCount = 1;
this.DefaultDelimiter = NavigationHelper.Slash;
this.AuthenticationScheme = AuthenticationScheme.SharedKey;
this.UsePathStyleUris = CommonUtility.UsePathStyleAddressing(this.BaseUri);
}
开发者ID:DaC24,项目名称:azure-storage-net,代码行数:14,代码来源:CloudBlobClient.Common.cs
示例14: CloudBlobClient
/// <summary>
/// Initializes a new instance of the <see cref="CloudBlobClient"/> class using the specified Blob service endpoint
/// and account credentials.
/// </summary>
/// <param name="storageUri">A <see cref="StorageUri"/> object containing the Blob service endpoint to use to create the client.</param>
/// <param name="credentials">A <see cref="StorageCredentials"/> object.</param>
public CloudBlobClient(StorageUri storageUri, StorageCredentials credentials)
{
this.StorageUri = storageUri;
this.Credentials = credentials ?? new StorageCredentials();
this.DefaultRequestOptions =
new BlobRequestOptions()
{
RetryPolicy = new ExponentialRetry(),
LocationMode = BlobRequestOptions.BaseDefaultRequestOptions.LocationMode,
SingleBlobUploadThresholdInBytes = BlobRequestOptions.BaseDefaultRequestOptions.SingleBlobUploadThresholdInBytes,
ParallelOperationThreadCount = BlobRequestOptions.BaseDefaultRequestOptions.ParallelOperationThreadCount
};
this.DefaultDelimiter = NavigationHelper.Slash;
this.AuthenticationScheme = AuthenticationScheme.SharedKey;
this.UsePathStyleUris = CommonUtility.UsePathStyleAddressing(this.BaseUri);
}
开发者ID:tamram,项目名称:azure-storage-net,代码行数:22,代码来源:CloudBlobClient.Common.cs
示例15: CloudTableClient
/// <summary>
/// Initializes a new instance of the <see cref="CloudTableClient"/> class using the specified Table service endpoint
/// and account credentials.
/// </summary>
/// <param name="storageUri">A <see cref="StorageUri"/> object containing the Table service endpoint to use to create the client.</param>
/// <param name="credentials">A <see cref="StorageCredentials"/> object.</param>
public CloudTableClient(StorageUri storageUri, StorageCredentials credentials)
{
this.StorageUri = storageUri;
this.Credentials = credentials ?? new StorageCredentials();
this.DefaultRequestOptions =
new TableRequestOptions(TableRequestOptions.BaseDefaultRequestOptions)
{
RetryPolicy = new ExponentialRetry()
};
this.AuthenticationScheme = AuthenticationScheme.SharedKey;
this.UsePathStyleUris = CommonUtility.UsePathStyleAddressing(this.BaseUri);
if (!this.Credentials.IsSharedKey)
{
this.AccountName = NavigationHelper.GetAccountNameFromUri(this.BaseUri, this.UsePathStyleUris);
}
}
开发者ID:Gajendra-Bahakar,项目名称:azure-storage-net,代码行数:23,代码来源:CloudTableClient.Common.cs
示例16: CloudTableClient
public CloudTableClient(StorageUri storageUri, StorageCredentials credentials)
#endif
{
this.StorageUri = storageUri;
this.Credentials = credentials ?? new StorageCredentials();
this.DefaultRequestOptions = new TableRequestOptions();
this.DefaultRequestOptions.RetryPolicy = new ExponentialRetry();
this.DefaultRequestOptions.LocationMode = RetryPolicies.LocationMode.PrimaryOnly;
this.DefaultRequestOptions.PayloadFormat = TablePayloadFormat.Json;
this.AuthenticationScheme = AuthenticationScheme.SharedKey;
this.UsePathStyleUris = CommonUtility.UsePathStyleAddressing(this.BaseUri);
if (!this.Credentials.IsSharedKey)
{
this.AccountName = NavigationHelper.GetAccountNameFromUri(this.BaseUri, this.UsePathStyleUris);
}
}
开发者ID:benaadams,项目名称:azure-storage-net,代码行数:17,代码来源:CloudTableClient.Common.cs
示例17: StorageUriWithTwoUris
public void StorageUriWithTwoUris()
{
Uri primaryClientUri = new Uri("http://" + AccountName + BlobService + EndpointSuffix);
Uri primaryContainerUri = new Uri(primaryClientUri, "container");
Uri secondaryClientUri = new Uri("http://" + AccountName + SecondarySuffix + BlobService + EndpointSuffix);
Uri dummyClientUri = new Uri("http://" + AccountName + "-dummy" + BlobService + EndpointSuffix);
StorageUri singleUri = new StorageUri(primaryClientUri);
Assert.IsTrue(primaryClientUri.Equals(singleUri.PrimaryUri));
Assert.IsNull(singleUri.SecondaryUri);
StorageUri singleUri2 = new StorageUri(primaryClientUri);
Assert.IsTrue(singleUri.Equals(singleUri2));
StorageUri singleUri3 = new StorageUri(secondaryClientUri);
Assert.IsFalse(singleUri.Equals(singleUri3));
StorageUri multiUri = new StorageUri(primaryClientUri, secondaryClientUri);
Assert.IsTrue(primaryClientUri.Equals(multiUri.PrimaryUri));
Assert.IsTrue(secondaryClientUri.Equals(multiUri.SecondaryUri));
Assert.IsFalse(multiUri.Equals(singleUri));
StorageUri multiUri2 = new StorageUri(primaryClientUri, secondaryClientUri);
Assert.IsTrue(multiUri.Equals(multiUri2));
TestHelper.ExpectedException<ArgumentException>(
() => new StorageUri(primaryClientUri, primaryContainerUri),
"StorageUri constructor should fail if both URIs do not point to the same resource");
StorageUri multiUri3 = new StorageUri(primaryClientUri, dummyClientUri);
Assert.IsFalse(multiUri.Equals(multiUri3));
StorageUri multiUri4 = new StorageUri(dummyClientUri, secondaryClientUri);
Assert.IsFalse(multiUri.Equals(multiUri4));
StorageUri multiUri5 = new StorageUri(secondaryClientUri, primaryClientUri);
Assert.IsFalse(multiUri.Equals(multiUri5));
}
开发者ID:DaC24,项目名称:azure-storage-net,代码行数:38,代码来源:StorageUriTests.cs
示例18: TransformUri
/// <summary>
/// Transforms a resource URI into a shared access signature URI, by appending a shared access token.
/// </summary>
/// <param name="resourceUri">A <see cref="StorageUri"/> object that represents the resource URI to be transformed.</param>
/// <returns>A <see cref="StorageUri"/> object that represents the signature, including the resource URI and the shared access token.</returns>
public StorageUri TransformUri(StorageUri resourceUri)
{
CommonUtility.AssertNotNull("resourceUri", resourceUri);
return new StorageUri(
this.TransformUri(resourceUri.PrimaryUri),
this.TransformUri(resourceUri.SecondaryUri));
}
开发者ID:tamram,项目名称:azure-storage-net,代码行数:13,代码来源:StorageCredentials.cs
示例19: CloudBlobContainer
internal CloudBlobContainer(StorageUri containerAddress, StorageCredentials credentials)
开发者ID:benaadams,项目名称:azure-storage-net,代码行数:1,代码来源:CloudBlobContainer.Common.cs
示例20: Create
/// <summary>
/// Initializes a new instance of the <see cref="CloudBlobContainer"/> class.
/// </summary>
/// <param name="containerAddress">A <see cref="System.Uri"/> object specifying the absolute URI to the container.</param>
/// <param name="credentials">A <see cref="StorageCredentials"/> object.</param>
#if WINDOWS_RT
/// <returns>A <see cref="CloudBlobContainer"/> object.</returns>
public static CloudBlobContainer Create(StorageUri containerAddress, StorageCredentials credentials)
{
return new CloudBlobContainer(containerAddress, credentials);
}
开发者ID:benaadams,项目名称:azure-storage-net,代码行数:11,代码来源:CloudBlobContainer.Common.cs
注:本文中的StorageUri类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论