Exportar (0) Imprimir
Expandir todo

CloudStorageAccount.Parse (Método)

Parses a connection string and returns a CloudStorageAccount created from the connection string.

Espacio de nombres: Microsoft.WindowsAzure
Ensamblado: Microsoft.WindowsAzure.StorageClient (en microsoft.windowsazure.storageclient.dll)

'Uso
Dim value As String
Dim returnValue As CloudStorageAccount

returnValue = CloudStorageAccount.Parse(value)

public static CloudStorageAccount Parse (
	string value
)
public static CloudStorageAccount Parse (
	String value
)
public static function Parse (
	value : String
) : CloudStorageAccount

Parámetros

value

A valid connection string.

Valor devuelto

A CloudStorageAccount object constructed from the values provided in the connection string.

The following code example parses a connection string and returns a CloudStorageAccount object, then lists account, credential, and endpoint information.

static void ParseCloudStorageAccountFromConnectionString()
{
    CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageAccountConnectionString"]);

    Console.WriteLine("Connection string: {0}", storageAccount.ToString(true));
    Console.WriteLine("Account name: {0}", storageAccount.Credentials.AccountName);
    Console.WriteLine("Account key: {0}", ((StorageCredentialsAccountAndKey)storageAccount.Credentials).Credentials.ExportBase64EncodedKey());
    Console.WriteLine("Blob endpoint: {0}", storageAccount.BlobEndpoint);
    Console.WriteLine("Queue endpoint: {0}", storageAccount.QueueEndpoint);
    Console.WriteLine("Table endpoint: {0}", storageAccount.TableEndpoint);
}

Tipo de excepciónCondición
ArgumentNullException

Thrown if value is null or empty.

FormatException

Thrown if value is not a valid connection string.

ArgumentException

Thrown if value cannot be parsed.

The Parse method parses a connection string and returns a reference to a CloudStorageAccount object. For details on working with connection strings, see How to Configure Connection Strings.


Cualquier miembro estático público (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Plataformas de desarrollo

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 y Windows 2000

Plataformas de destino

Adiciones de comunidad

Mostrar:
© 2014 Microsoft