Beispiel #1
0
        /// <summary>
        /// 把中文特征名称转换成英文,或转换成繁体中文。
        /// </summary>
        internal static string CEN(string cnName)
        {
            if (AllData.iSWLanguage <= 1)
            {
                return(cnName);//中文无需转换
            }

            //去除数字,如【草图1>>草图】//如D1@阵列(圆周)1
            string[] strArr = cnName.Split(new char[] { '@' });

            if (AllData.iSWLanguage == 2)
            {
                if (htEnglishEncoding == null)
                {
                    cfgInfo cinfo = new cfgInfo();
                    htEnglishEncoding = cinfo.getAllValue(AllData.StartUpPath + "\\GB2312-English.cfg");
                }

                foreach (string SA in strArr)
                {
                    string SB = StringOperate.RemoveNumber(SA);//阵列(圆周)
                    if (htEnglishEncoding.ContainsKey(SB))
                    {
                        string val = htEnglishEncoding[SB].ToString();
                        if (val.Length > 0)
                        {
                            cnName = cnName.Replace(SB, val);
                        }
                    }
                }
            }
            else if (AllData.iSWLanguage == 3)
            {
                if (htBig5Encoding == null)
                {
                    cfgInfo cinfo = new cfgInfo();
                    htBig5Encoding = cinfo.getAllValue(AllData.StartUpPath + "\\GB2312-BIG5.cfg");
                }

                foreach (string SA in strArr)
                {
                    string SB = StringOperate.RemoveNumber(SA);//阵列(圆周)
                    if (htBig5Encoding.ContainsKey(SB))
                    {
                        string val = htBig5Encoding[SB].ToString();
                        if (val.Length > 0)
                        {
                            cnName = cnName.Replace(SB, val);
                        }
                    }
                    else
                    {
                        cnName = cnName.Replace(SB, Big5Convert(SB));
                    }
                }
            }

            return(cnName);
        }
Beispiel #2
0
        //开始注册
        private void button1_Click(object sender, EventArgs e)
        {
            string txtcode = this.textBox1.Text.Trim().Replace(" ", "");

            cfgInfo cinfo = new cfgInfo();

            cinfo.setValue("mdcode", txtcode, "regcode.cfg");

            this.Close();
        }
Beispiel #3
0
        private void FrmMgrWindow_Load(object sender, EventArgs e)
        {
            cfgInfo cinfo = new cfgInfo();

            this.textBox1.Text = cinfo.getValue("mdcode", "regcode.cfg");
        }