예제 #1
0
        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}";
        }
예제 #2
0
        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}";
        }