SoundPlayer.SoundLocation Eigenschaft

Definition

Ruft den Dateipfad oder die URL der zu ladenden WAV-Datei ab oder legt diesen bzw. diese fest.

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

Eigenschaftswert

Der Dateipfad oder die URL, aus dem bzw. der eine WAV-Datei geladen werden soll, oder Empty, wenn kein Dateipfad vorhanden ist. Der Standardwert ist Empty.

Beispiele

Im folgenden Codebeispiel wird die Verwendung der SoundLocation -Eigenschaft veranschaulicht, um die QUELLE der WAV-Datei einem instance der SoundPlayer -Klasse zuzuweisen. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die SoundPlayer-Klasse bereitgestellt wird.

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

Hinweise

Diese Eigenschaft wird auf String.Empty festgelegt, wenn die Stream -Eigenschaft auf festgelegt Streamwird.

Gilt für:

Weitere Informationen