Exportera (0) Skriv ut
Visa allt
EN
Det här innehållet finns inte tillgängligt på ditt språk men här finns den engelska versionen,

CloudBlob.UploadText Method (String)

Updated: April 24, 2013

[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See Storage Client Library for the latest version.]

Uploads a string of text to a block blob.

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

'Användning
Dim instance As CloudBlob
Dim content As String

instance.UploadText(content)

public virtual void UploadText (
	string content
)

Parameters

content

Type: System.String

The text to upload, which will be encoded as a UTF-8 string.

The following code example uploads a blob from text. This example overwrites the blob if it already exists in the container.

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

    // Get a reference to the blob.
    CloudBlob blob = blobClient.GetBlobReference("mycontainer/myblob.txt");

    // Upload the blob from a text string.
    blob.UploadText("Upload a blob from text.");
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

 

Visa:
© 2014 Microsoft