匯出 (0) 列印
全部展開

CloudTableClient.EndCreateTableIfNotExist 方法

Ends an asynchronous operation to create a table with the specified name if it does not already exist.

命名空間: Microsoft.WindowsAzure.StorageClient
組件: Microsoft.WindowsAzure.StorageClient (在 microsoft.windowsazure.storageclient.dll 中)

'用途
Dim instance As CloudTableClient
Dim asyncResult As IAsyncResult
Dim returnValue As Boolean

returnValue = instance.EndCreateTableIfNotExist(asyncResult)

public bool EndCreateTableIfNotExist (
	IAsyncResult asyncResult
)
public boolean EndCreateTableIfNotExist (
	IAsyncResult asyncResult
)
public function EndCreateTableIfNotExist (
	asyncResult : IAsyncResult
) : boolean

參數

asyncResult

An IAsyncResult that references the pending asynchronous operation.

傳回值

true if table was created; otherwise, false.

The following code example creates a table asynchronously if it does not exist.

static void CreateTableIfNotExistsAsync(CloudStorageAccount storageAccount)
{
    // Create service client for credentialed access to the Table service.
    CloudTableClient tableClient = new CloudTableClient(storageAccount.TableEndpoint.ToString(),
        storageAccount.Credentials);

    // Begin the operation to create a new table.
    tableClient.BeginCreateTableIfNotExist("Categories", CreateTableIfNotExistsAsyncCallback, tableClient);
}

public static void CreateTableIfNotExistsAsyncCallback(IAsyncResult result)
{
    CloudTableClient tableClient = (CloudTableClient)result.AsyncState;

    // End the operation.
    if (tableClient.EndCreateTableIfNotExist(result))
    {
        Console.WriteLine("Table created."); 
    }
}

任何這個類型的公用靜態 (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。 並非所有的執行個體成員都是安全執行緒。

開發平台

Windows XP Home Edition, Windows XP Professional, Windows Server 2003、Windows Server 2008 和 Windows 2000

目標平台

社群新增項目

顯示:
© 2014 Microsoft