SoundPlayer.SoundLocation Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém ou define o caminho do ficheiro ou URL do ficheiro .wav para carregar.
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 de Propriedade
O caminho do ficheiro ou URL a partir do qual carregar um ficheiro .wav, ou Empty se não houver caminho de ficheiro. A predefinição é Empty.
Exemplos
O exemplo de código seguinte demonstra a utilização da SoundLocation propriedade para atribuir a fonte do ficheiro .wav a uma instância da SoundPlayer classe. Este exemplo de código faz parte de um exemplo maior fornecido para a SoundPlayer classe.
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
Observações
Esta propriedade é definida para String.Empty quando a Stream propriedade é definida como um Stream.