SoundPlayer.SoundLocation Свойство

Определение

Возвращает или задает путь к файлу или URL-адрес загружаемого WAV-файла.

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

Значение свойства

Путь к файлу или URL-адрес для загрузки WAV-файла или значение Empty, если путь к файлу отсутствует. Значение по умолчанию — Empty.

Примеры

В следующем примере кода показано использование свойства для SoundLocation назначения источника файла .wav экземпляру SoundPlayer класса . Этот пример входит в состав более крупного примера использования класса SoundPlayer.

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

Комментарии

Этому свойству присваивается значение String.Empty , если свойству Stream присвоено Streamзначение .

Применяется к

См. также раздел