SoundPlayer.SoundLocation Proprietà

Definizione

Ottiene o imposta il percorso di file o l'URL del file wav da caricare.

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

Valore della proprietà

Percorso di file o URL da cui caricare un file wav oppure Empty se non è presente alcun percorso di file. Il valore predefinito è Empty.

Esempio

Nell'esempio di codice seguente viene illustrato l'uso della SoundLocation proprietà per assegnare l'origine file .wav a un'istanza della SoundPlayer classe . Questo esempio di codice fa parte di un esempio più ampio fornito per la 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

Commenti

Questa proprietà viene impostata su String.Empty quando la Stream proprietà è impostata su .Stream

Si applica a

Vedi anche