Dışarıya aktar (0) Yazdır
Tümünü Genişlet
EN
Bu içerik dilinizde bulunmamaktadır ancak İngilizce sürümüne buradan bakabilirsiniz.

CloudBlobClient Constructor (Uri, StorageCredentials)

Updated: April 24, 2011

[This topic is part of the Windows Azure Storage Client Library 1.7, which has been deprecated. The current recommended version is Storage Client Library 3.0.]

Initializes a new instance of the CloudBlobClient class using the specified Blob service endpoint and account credentials.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)

'Kullanım

public CloudBlobClient (
	Uri baseUri,
	StorageCredentials credentials
)

Parameters

baseUri

Type: System.Uri

The Blob service endpoint to use to create the client.

credentials

Type: Microsoft.WindowsAzure.StorageCredentials

The account credentials.

The following code example creates a credentialed service client and uploads text content to a blob.

static void UploadBlobFromFile(Uri blobEndpoint, string accountName, string accountKey)
{
    //Create service client for credentialed access to the Blob service.
    CloudBlobClient blobClient =
        new CloudBlobClient(blobEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey));

    //Get a reference to a container, which may or may not exist.
    CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
            
    //Create a new container, if it does not exist
    container.CreateIfNotExist();

    //Get a reference to a blob, which may or may not exist.
    CloudBlob blob = container.GetBlobReference("myfile.txt");

    //Upload content to the blob, which will create the blob if it does not already exist.
    blob.UploadFile("c:\\myfile.txt");
}


Development Platforms

Windows Vista, Windows 7 and Windows Server 2008

Target Platforms

Show:
© 2014 Microsoft