CloudQueue Constructor
From Storage Client Library NET API
[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.]
Initializes a new instance of the CloudQueue class.
Initializes a new instance of the CloudQueue class.
Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)
Usage
| Visual Basic |
|---|
Dim address As String Dim credentials As StorageCredentials Dim instance As New CloudQueue(address, credentials) |
Syntax
| Visual Basic |
|---|
Public Sub New ( _ address As String, _ credentials As StorageCredentials _ ) |
| C# |
|---|
public CloudQueue ( string address, StorageCredentials credentials ) |
| C++ |
|---|
public: CloudQueue ( String^ address, StorageCredentials^ credentials ) |
| J# |
|---|
| JScript |
|---|
Parameters
- address
Type: System.String
The absolute URI to the queue.
- credentials
Type: Microsoft.WindowsAzure.StorageCredentials
The account credentials.
Example
The following code example uses the CloudQueue constructor to create a queue:
| C# | |
|---|---|
public CloudQueue CreateNewQueue(string queueAbsoluteURI, string AccountName, string AccessKey )
{
StorageCredentialsAccountAndKey credentials;
CloudQueue newQueue = null;
try
{
credentials = new StorageCredentialsAccountAndKey( AccountName, AccessKey );
newQueue = new CloudQueue( queueAbsoluteURI, credentials );
newQueue.Create( );
}
catch( Exception ex )
{
Trace.TraceError( string.Format(
"Failed to create new CloudQueue at URI '{0}'; reason: {1}.",
queueAbsoluteURI, ex.Message ) );
return ( null );
}
return ( newQueue );
}
| |
Remarks
See the GetQueueReference method for an alternate way to create a new CloudQueue object.