Exemplo n.º 1
0
        private void btnAPT_Click(object sender, EventArgs e)
        {
            Txt2List txt2list = new Txt2List();
            List2Txt list2txt = new List2Txt();

            List <string> tmplist = new List <string>();


            OpenFileDialog openDlg = new OpenFileDialog();

            openDlg.Filter = "txt_APT文件|*.txt";

            if (openDlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            string fileName = openDlg.FileName;

            StreamReader sr = new StreamReader(fileName, Encoding.Default);

            this.rtxbapt.Text = sr.ReadToEnd();

            sr.Close();


            tmplist = txt2list.ReadTxtToList(fileName);
            list2txt.ListToTxtFile(tmplist, "D:middleTranslation0.txt");
        }
Exemplo n.º 2
0
        public string Apt2JbiFirst(string fileName)
        {
            Txt2List txt2list=new Txt2List ();
            List2Txt list2txt=new List2Txt ();

            List<string> tmplist = new List<string>();

            FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);

            StreamReader sr = new StreamReader(fs);

            sr.BaseStream.Seek(0, SeekOrigin.Begin);

            string tmp = sr.ReadLine();

            while (tmp != null)
            {

                    if (tmp.StartsWith( "GOTO") || tmp.StartsWith( "CIRCLE"))
                    {
                        tmplist.Add(tmp);
                    }

             tmp = sr.ReadLine();

            }

               sr.Close();
            fs.Close();
               string tmpjbistr="d:middleTranslation1.txt";
            list2txt.ListToTxtFile(tmplist,tmpjbistr );

            return tmpjbistr;
        }
Exemplo n.º 3
0
        public string  Apt2JbiFirst(string fileName)
        {
            Txt2List txt2list = new Txt2List();
            List2Txt list2txt = new List2Txt();

            List <string> tmplist = new List <string>();


            FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);

            StreamReader sr = new StreamReader(fs);

            sr.BaseStream.Seek(0, SeekOrigin.Begin);

            string tmp = sr.ReadLine();

            while (tmp != null)
            {
                if (tmp.StartsWith("GOTO") || tmp.StartsWith("CIRCLE"))
                {
                    tmplist.Add(tmp);
                }

                tmp = sr.ReadLine();
            }


            sr.Close();
            fs.Close();
            string tmpjbistr = "d:middleTranslation1.txt";

            list2txt.ListToTxtFile(tmplist, tmpjbistr);

            return(tmpjbistr);
        }
Exemplo n.º 4
0
        private void btnAPT_Click(object sender, EventArgs e)
        {
            Txt2List txt2list = new Txt2List();
            List2Txt list2txt = new List2Txt();

            List<string> tmplist = new List<string>();

            OpenFileDialog openDlg = new OpenFileDialog();

            openDlg.Filter = "txt_APT文件|*.txt";

            if (openDlg.ShowDialog() != DialogResult.OK) return;

            string fileName = openDlg.FileName;

            StreamReader sr = new StreamReader(fileName, Encoding.Default);

            this.rtxbapt.Text = sr.ReadToEnd();

            sr.Close();

            tmplist = txt2list.ReadTxtToList(fileName);
            list2txt.ListToTxtFile(tmplist, "D:middleTranslation0.txt");
        }