Exportar (0) Imprimir
Expandir todo

CloudDrive.GetMountedDrives (Método)

Returns a mapping of drive letters for mounted drives to page blob URIs for the current role instance.

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

'Uso
Dim returnValue As IDictionary(Of String, Uri)

returnValue = CloudDrive.GetMountedDrives

public static IDictionary<string,Uri> GetMountedDrives ()
public static IDictionary<String,Uri> GetMountedDrives ()
public static function GetMountedDrives () : IDictionary<String,Uri>

Valor devuelto

A read-only dictionary that maps local paths to page blob URIs.

The following code example creates and mounts several drives, then lists the mounted drives.

public void ListMountedDrives()
{
    // Use the storage emulator.
    CloudStorageAccount storageAccount = CloudStorageAccount.DevelopmentStorageAccount;

    // Create the Blob service client.
    CloudBlobClient client = storageAccount.CreateCloudBlobClient();

    // Create the container for the drive if it does not already exist.
    CloudBlobContainer container = new CloudBlobContainer("mydrives", client);
    container.CreateIfNotExist();

    for (int i = 0; i < 10; i++)
    {
        try
        {
            // Get a reference to the page blob that will back the drive.
            CloudPageBlob pageBlob = container.GetPageBlobReference("myvhd" + i.ToString());

            // Return a reference to the drive backed by the specified page blob. 
            CloudDrive drive = new CloudDrive(pageBlob.Uri, storageAccount.Credentials);

            // Create a 20 MB drive.
            drive.Create(20);

            // Mount the drive.
            drive.Mount(0, DriveMountOptions.None);
        }
        catch (CloudDriveException e)
        {
            System.Diagnostics.Debug.WriteLine(e.Message);
        }
    }

    // List each drive letter and associated page blob.
    foreach (var item in CloudDrive.GetMountedDrives())
    {
        System.Diagnostics.Debug.WriteLine("Drive letter: " + item.Key);
        System.Diagnostics.Debug.WriteLine("Page blob URI: " + item.Value);
    }
}

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