本文整理汇总了C#中CloudStorageAccount.CreateCloudFileClient方法的典型用法代码示例。如果您正苦于以下问题:C# CloudStorageAccount.CreateCloudFileClient方法的具体用法?C# CloudStorageAccount.CreateCloudFileClient怎么用?C# CloudStorageAccount.CreateCloudFileClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CloudStorageAccount
的用法示例。
在下文中一共展示了CloudStorageAccount.CreateCloudFileClient方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloudStorageAccountClientMethods
public void CloudStorageAccountClientMethods()
{
CloudStorageAccount account = new CloudStorageAccount(TestBase.StorageCredentials, false);
CloudBlobClient blob = account.CreateCloudBlobClient();
CloudQueueClient queue = account.CreateCloudQueueClient();
CloudTableClient table = account.CreateCloudTableClient();
CloudFileClient file = account.CreateCloudFileClient();
// check endpoints
Assert.AreEqual(account.BlobEndpoint, blob.BaseUri, "Blob endpoint doesn't match account");
Assert.AreEqual(account.QueueEndpoint, queue.BaseUri, "Queue endpoint doesn't match account");
Assert.AreEqual(account.TableEndpoint, table.BaseUri, "Table endpoint doesn't match account");
Assert.AreEqual(account.FileEndpoint, file.BaseUri, "File endpoint doesn't match account");
// check storage uris
Assert.AreEqual(account.BlobStorageUri, blob.StorageUri, "Blob endpoint doesn't match account");
Assert.AreEqual(account.QueueStorageUri, queue.StorageUri, "Queue endpoint doesn't match account");
Assert.AreEqual(account.TableStorageUri, table.StorageUri, "Table endpoint doesn't match account");
Assert.AreEqual(account.FileStorageUri, file.StorageUri, "File endpoint doesn't match account");
// check creds
Assert.AreEqual(account.Credentials, blob.Credentials, "Blob creds don't match account");
Assert.AreEqual(account.Credentials, queue.Credentials, "Queue creds don't match account");
Assert.AreEqual(account.Credentials, table.Credentials, "Table creds don't match account");
Assert.AreEqual(account.Credentials, file.Credentials, "File creds don't match account");
}
示例2: CloudStorageAccountClientUriVerify
public void CloudStorageAccountClientUriVerify()
{
StorageCredentials cred = new StorageCredentials(TestBase.TargetTenantConfig.AccountName, TestBase.TargetTenantConfig.AccountKey);
CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(cred, true);
CloudBlobClient blobClient = cloudStorageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("container1");
Assert.AreEqual(cloudStorageAccount.BlobEndpoint.ToString() + "container1", container.Uri.ToString());
CloudQueueClient queueClient = cloudStorageAccount.CreateCloudQueueClient();
CloudQueue queue = queueClient.GetQueueReference("queue1");
Assert.AreEqual(cloudStorageAccount.QueueEndpoint.ToString() + "queue1", queue.Uri.ToString());
CloudTableClient tableClient = cloudStorageAccount.CreateCloudTableClient();
CloudTable table = tableClient.GetTableReference("table1");
Assert.AreEqual(cloudStorageAccount.TableEndpoint.ToString() + "table1", table.Uri.ToString());
CloudFileClient fileClient = cloudStorageAccount.CreateCloudFileClient();
CloudFileShare share = fileClient.GetShareReference("share1");
Assert.AreEqual(cloudStorageAccount.FileEndpoint.ToString() + "share1", share.Uri.ToString());
}
示例3: CloudStorageAccountWithStorageUri
public void CloudStorageAccountWithStorageUri()
{
StorageUri blobEndpoint = new StorageUri(
new Uri("http://" + AccountName + BlobService + EndpointSuffix),
new Uri("http://" + AccountName + SecondarySuffix + BlobService + EndpointSuffix));
StorageUri queueEndpoint = new StorageUri(
new Uri("http://" + AccountName + QueueService + EndpointSuffix),
new Uri("http://" + AccountName + SecondarySuffix + QueueService + EndpointSuffix));
StorageUri tableEndpoint = new StorageUri(
new Uri("http://" + AccountName + TableService + EndpointSuffix),
new Uri("http://" + AccountName + SecondarySuffix + TableService + EndpointSuffix));
StorageUri fileEndpoint = new StorageUri(
new Uri("http://" + AccountName + FileService + EndpointSuffix),
new Uri("http://" + AccountName + SecondarySuffix + FileService + EndpointSuffix));
#if WINDOWS_RT || ASPNET_K
CloudStorageAccount account = CloudStorageAccount.Create(new StorageCredentials(), blobEndpoint, queueEndpoint, tableEndpoint, fileEndpoint);
#else
CloudStorageAccount account = new CloudStorageAccount(new StorageCredentials(), blobEndpoint, queueEndpoint, tableEndpoint, fileEndpoint);
#endif
Assert.IsTrue(blobEndpoint.Equals(account.BlobStorageUri));
Assert.IsTrue(queueEndpoint.Equals(account.QueueStorageUri));
Assert.IsTrue(tableEndpoint.Equals(account.TableStorageUri));
Assert.IsTrue(fileEndpoint.Equals(account.FileStorageUri));
account = new CloudStorageAccount(new StorageCredentials(AccountName, TestBase.StorageCredentials.ExportBase64EncodedKey()), false);
Assert.IsTrue(blobEndpoint.Equals(account.BlobStorageUri));
Assert.IsTrue(queueEndpoint.Equals(account.QueueStorageUri));
Assert.IsTrue(tableEndpoint.Equals(account.TableStorageUri));
Assert.IsTrue(fileEndpoint.Equals(account.FileStorageUri));
account = CloudStorageAccount.Parse(string.Format("DefaultEndpointsProtocol=http;AccountName={0};AccountKey=", AccountName));
Assert.IsTrue(blobEndpoint.Equals(account.BlobStorageUri));
Assert.IsTrue(queueEndpoint.Equals(account.QueueStorageUri));
Assert.IsTrue(tableEndpoint.Equals(account.TableStorageUri));
Assert.IsTrue(fileEndpoint.Equals(account.FileStorageUri));
Assert.IsTrue(blobEndpoint.Equals(account.CreateCloudBlobClient().StorageUri));
Assert.IsTrue(queueEndpoint.Equals(account.CreateCloudQueueClient().StorageUri));
Assert.IsTrue(tableEndpoint.Equals(account.CreateCloudTableClient().StorageUri));
Assert.IsTrue(fileEndpoint.Equals(account.CreateCloudFileClient().StorageUri));
Assert.IsTrue(blobEndpoint.PrimaryUri.Equals(account.BlobEndpoint));
Assert.IsTrue(queueEndpoint.PrimaryUri.Equals(account.QueueEndpoint));
Assert.IsTrue(tableEndpoint.PrimaryUri.Equals(account.TableEndpoint));
Assert.IsTrue(fileEndpoint.PrimaryUri.Equals(account.FileEndpoint));
}