CloudQueue Constructor

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.

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# Copy Code
  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.


Platforms

Development Platforms

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

Change History

See Also