SoundPlayer.SoundLocation Propriedade

Definição

Obtém ou define o caminho do arquivo ou URL do arquivo .wav a ser carregado.Gets or sets the file path or URL of the .wav file to load.

public:
 property System::String ^ SoundLocation { System::String ^ get(); void set(System::String ^ value); };
public string SoundLocation { get; set; }
member this.SoundLocation : string with get, set
Public Property SoundLocation As String

Valor da propriedade

String

O caminho do arquivo ou a URL da qual carregar um arquivo .wav ou Empty se nenhum caminho de arquivo estiver presente.The file path or URL from which to load a .wav file, or Empty if no file path is present. O padrão é Empty.The default is Empty.

Exemplos

O exemplo de código a seguir demonstra o uso da SoundLocation propriedade para atribuir a origem do arquivo. wav a uma instância da SoundPlayer classe.The following code example demonstrates the use of the SoundLocation property to assign the .wav file source to an instance of the SoundPlayer class. Este exemplo de código faz parte de um exemplo maior fornecido para a SoundPlayer classe.This code example is part of a larger example provided for the SoundPlayer class.

try
{
   
   // Assign the selected file's path to 
   // the SoundPlayer object.  
   player->SoundLocation = filepathTextbox->Text;
   
   // Load the .wav file.
   player->Load();
}
catch ( Exception^ ex ) 
{
   ReportStatus( ex->Message );
}


try
{
    // Assign the selected file's path to 
    // the SoundPlayer object.  
    player.SoundLocation = filepathTextbox.Text;

    // Load the .wav file.
    player.Load();
}
catch (Exception ex)
{
    ReportStatus(ex.Message);
}
Try
    ' Assign the selected file's path to the SoundPlayer object.
    player.SoundLocation = filepathTextbox.Text

    ' Load the .wav file.
    player.Load()
Catch ex As Exception
    ReportStatus(ex.Message)
End Try

Comentários

Essa propriedade é definida como String.Empty quando a Stream propriedade é definida como um Stream .This property is set to String.Empty when the Stream property is set to a Stream.

Aplica-se a