Taal

SoundPlayer.SoundLocation Eigenschap

Definitie

Hiermee wordt het bestandspad of de URL van het .wav-bestand dat moet worden geladen, opgeslagen of ingesteld.

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

Waarde van eigenschap

Het bestandspad of de URL van waaruit een .wav bestand moet worden geladen of Empty als er geen bestandspad aanwezig is. De standaardwaarde is Empty.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe de SoundLocation eigenschap wordt gebruikt om de .wav bestandsbron toe te wijzen aan een exemplaar van de SoundPlayer klasse. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de SoundPlayer klasse.

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

Opmerkingen

Deze eigenschap wordt ingesteld op String.Empty wanneer de Stream eigenschap is ingesteld op een Stream.

Van toepassing op

Zie ook