本文整理汇总了C#中StorageUri类的典型用法代码示例。如果您正苦于以下问题:C# StorageUri类的具体用法?C# StorageUri怎么用?C# StorageUri使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StorageUri类属于命名空间,在下文中一共展示了StorageUri类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloudFileDirectory
public CloudFileDirectory(StorageUri directoryAbsoluteUri, StorageCredentials credentials)
#endif
{
this.Metadata = new Dictionary<string, string>();
this.Properties = new FileDirectoryProperties();
this.ParseQueryAndVerify(directoryAbsoluteUri, credentials);
}
示例2: CloudQueue
public CloudQueue(StorageUri queueAddress, StorageCredentials credentials)
#endif
{
this.ParseQueryAndVerify(queueAddress, credentials);
this.Metadata = new Dictionary<string, string>();
this.EncodeMessage = true;
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}