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"); }
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; }
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); }
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"); }