SoundPlayer.SoundLocation Propriété

Définition

Obtient ou définit le chemin d'accès ou l'URL du fichier .wav à charger.

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

Valeur de propriété

Chemin d'accès ou URL à partir desquels charger un fichier .wav, ou Empty si aucun chemin d'accès n'est présent. La valeur par défaut est Empty.

Exemples

L’exemple de code suivant illustre l’utilisation de la SoundLocation propriété pour affecter la source de fichier .wav à un instance de la SoundPlayer classe. Cet exemple de code fait partie d’un exemple plus grand fourni pour 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

Remarques

Cette propriété est définie sur String.Empty lorsque la Stream propriété a la Streamvaleur .

S’applique à

Voir aussi