Beispiel #1
0
        private void MapStringFromFdf(string fdfpath) //必须要新建了inilist_sw才能用。
        {
            fdf_file     fdf = new fdf_file(fdfpath);
            StreamWriter sw  = new StreamWriter(fdfpath, false);

            sw.Write(fdf.head + Environment.NewLine);
            for (int i = 0; i < fdf.body.Count; i++)
            {
                string line  = (string)fdf.body[i];
                int    start = line.IndexOf('"') + 1;
                if (line.Trim() != "" && start != 0 && HasChinese(line))
                {
                    string replacement = line.Substring(start, line.LastIndexOf('"') - start);
                    line = line.Replace(replacement, "INI_STRING " + pos.ToString());
                    inilist_sw.WriteLine(pos.ToString() + " | " + replacement);
                    pos++;
                }
                sw.WriteLine(line);
            }
            sw.Write(fdf.feet);
            sw.Close();
        }
Beispiel #2
0
 //必须要新建了inilist_sw才能用。
 private void MapStringFromFdf(string fdfpath)
 {
     fdf_file fdf = new fdf_file(fdfpath);
     StreamWriter sw = new StreamWriter(fdfpath, false);
     sw.Write(fdf.head+Environment.NewLine);
     for (int i = 0; i < fdf.body.Count; i++)
     {
         string line = (string)fdf.body[i];
         int start=line.IndexOf('"') + 1;
         if (line.Trim() != "" && start != 0 && HasChinese(line))
         {
             string replacement = line.Substring(start, line.LastIndexOf('"') - start);
             line = line.Replace(replacement, "INI_STRING " + pos.ToString());
             inilist_sw.WriteLine(pos.ToString() + " | " + replacement);
             pos++;
         }
         sw.WriteLine(line);
     }
     sw.Write(fdf.feet);
     sw.Close();
 }