銷售: 1-800-867-1380
EN
本內容沒有您的語言版本,但有英文版本。

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)

'用途
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

 

本文對您有任何幫助嗎?
(剩餘 1500 個字元)
感謝您提供意見
顯示:
© 2014 Microsoft