Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введите путь к распаковывему файлу");
            string filename;
            //filename = Console.ReadLine();
            //string extractPath = Unarchiver.EV3Extract(filename);
            List <DeserializedProgram> deserializedProgram = new List <DeserializedProgram>();
            string extractPath = Console.ReadLine();

            if (extractPath != null)
            {
                Console.WriteLine(true);
                string[] programFiles = Directory.GetFiles(extractPath, "*.ev3p");
                foreach (string programName in programFiles)
                {
                    string textFile;
                    using (StreamReader reader = new StreamReader(programName))
                    {
                        textFile = reader.ReadToEnd();
                        textFile = textFile.Replace("xmlns=", "notlink=");
                    }
                    using (StreamWriter writer = new StreamWriter(programName, false))
                    {
                        writer.Write(textFile);
                    }

                    deserializedProgram.Add(SourceFile.Deserialize(programName));
                }
            }
            else
            {
                Console.WriteLine(false);
            }
        }