啊鑫
2024-07-11 afbf8700d137710713db61955879d0f5acb73738
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#region
 
using System;
using System.Windows.Forms;
 
#endregion
 
namespace CSFrameworkV5.Language
{
    public partial class frmBaiduTrans : Form
    {
        private bool _OK;
 
        private frmBaiduTrans()
        {
            InitializeComponent();
        }
 
        private void btnTran_Click(object sender, EventArgs e)
        {
            if (txtLanTo.Text != "")
            {
                _OK = true;
                Close();
            }
            else
            {
                txtLanTo.Focus();
            }
        }
 
        public static string Execute()
        {
            var form = new frmBaiduTrans();
            form.ShowDialog();
            return form.GetTargetLan();
        }
 
        private void frmBaiduTrans_Load(object sender, EventArgs e)
        {
            txtLanFrom.Text = "中文简体";
            txtLanTo.Text = "英文";
        }
 
        private string GetTargetLan()
        {
            if (_OK)
            {
                if (txtLanTo.Text == "中文繁体") return "cht";
 
                if (txtLanTo.Text == "英文") return "en";
 
                if (txtLanTo.Text == "越南文") return "vie";
            }
 
            return "";
        }
    }
}