Esporta (0) Stampa
Espandi tutto

Costruttore CloudBlobClient (Uri, StorageCredentials)

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

Spazio dei nomi: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in microsoft.windowsazure.storageclient.dll)

'Utilizzo
Dim baseUri As Uri
Dim credentials As StorageCredentials

Dim instance As New CloudBlobClient(baseUri, credentials)

public CloudBlobClient (
	Uri baseUri,
	StorageCredentials credentials
)
public CloudBlobClient (
	Uri baseUri, 
	StorageCredentials credentials
)
public function CloudBlobClient (
	baseUri : Uri, 
	credentials : StorageCredentials
)

Parametri

baseUri

The Blob service endpoint to use to create the client.

credentials

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");
}


Piattaforme di sviluppo

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 e Windows 2000

Piattaforme di destinazione

Aggiunte alla community

Mostra:
© 2014 Microsoft