private void button2_Click(object sender, EventArgs e) { var result = MSTranslatorUtility.Translate(this.textBox1.Text, "en"); //zh-Hant 為翻譯成中文 this.textBox2.Text = $"目標語系 : { result.FirstOrDefault().translations.FirstOrDefault().to}"; this.textBox2.Text += $"\r\n翻譯結果 : { result.FirstOrDefault().translations.FirstOrDefault().text}"; }
private void button1_Click(object sender, EventArgs e) { var result = MSTranslatorUtility.Detect(this.textBox1.Text); this.textBox2.Text = $"最有可能的語系是 : { result.FirstOrDefault().language}"; this.textBox2.Text += $"\r\n分數 : { result.FirstOrDefault().score}"; }