共用方式為


RecognizerInfo.Culture 屬性

定義

取得 SpeechRecognizerSpeechRecognitionEngine 執行個體所支援的文化特性。

public:
 property System::Globalization::CultureInfo ^ Culture { System::Globalization::CultureInfo ^ get(); };
public System.Globalization.CultureInfo Culture { get; }
member this.Culture : System.Globalization.CultureInfo
Public ReadOnly Property Culture As CultureInfo

屬性值

傳回指定之 SpeechRecognizerSpeechRecognitionEngine 執行個體支援的文化特性的相關資訊。

範例

下列範例會實作按鈕按一下,以顯示 實例中的所有 RecognizerInfo 資訊。 此範例會 Culture 使用 屬性來取得辨識引擎組態所使用 之 的識別字串 CultureInfo

private void recognizerInfoButton_Click(object sender, EventArgs e)   
{  
  RecognizerInfo info = _recognizer.RecognizerInfo;  
  string AudioFormats = "";  
  foreach (SpeechAudioFormatInfo fmt in info.SupportedAudioFormats)   
  {  
    AudioFormats += String.Format("       {0}\n", fmt.EncodingFormat.ToString());  
  }  
  string AdditionalInfo = "";  
  foreach (string key in info.AdditionalInfo.Keys)   
  {  
    AdditionalInfo += String.Format("      {0}: {1}\n", key, info.AdditionalInfo[key]);  
  }  
  MessageBox.Show(String.Format(  
                     "Name:                 {0 }\n" +  
                     "Description:          {1} \n" +  
                     "SupportedAudioFormats:\n" +  
                     "{2} " +  
                     "Culture:              {3} \n" +  
                     "AdditionalInfo:       \n" +  
                     " {4}\n",  
                     info.Name.ToString(),  
                     info.Description.ToString(),  
                     AudioFormats,  
                     info.Culture.ToString(),  
                     AdditionalInfo));  
}  

備註

CultureInfo物件可以包含文化特性的名稱、相關聯的語言、國家/地區、使用的行事曆,以及如何格式化日期和排序字串。

適用於

另請參閱