Ejemplo n.º 1
1
        public Program()
        {
            string[] dirs=Directory.GetDirectories(".");
            foreach (string dir in dirs)
            {

                DataBase.AnimatedBitmap an = new DataBase.AnimatedBitmap();
                an._Name =Path.GetFileName(dir);
                foreach (string file in Directory.GetFiles(dir))
                    if (Regex.IsMatch(Path.GetExtension(file), "jpg|png", RegexOptions.IgnoreCase))
                        an._Bitmaps.Add(file.Replace(@"\", "/","./",""));

                if (an._Bitmaps.Count > 0)
                {
                    Image img = Bitmap.FromFile(an._Bitmaps.First());
                    an._Width = img.Width;
                    an._Height = img.Height;
                    _DataBase._AnimatedBitmaps.Add(an);

                }
            }
            Common._XmlSerializer.Serialize("./db.xml", _DataBase);

            FastZip _FastZip = new FastZip();
            _FastZip.CreateZip("content.zip","./",true,@"\.jpg|\.png|.\xml");
        }
Ejemplo n.º 2
0
        public Program()
        {
            string[] dirs = Directory.GetDirectories(".");
            foreach (string dir in dirs)
            {
                DataBase.AnimatedBitmap an = new DataBase.AnimatedBitmap();
                an._Name = Path.GetFileName(dir);
                foreach (string file in Directory.GetFiles(dir))
                {
                    if (Regex.IsMatch(Path.GetExtension(file), "jpg|png", RegexOptions.IgnoreCase))
                    {
                        an._Bitmaps.Add(file.Replace(@"\", "/", "./", ""));
                    }
                }

                if (an._Bitmaps.Count > 0)
                {
                    Image img = Bitmap.FromFile(an._Bitmaps.First());
                    an._Width  = img.Width;
                    an._Height = img.Height;
                    _DataBase._AnimatedBitmaps.Add(an);
                }
            }
            Common._XmlSerializer.Serialize("./db.xml", _DataBase);

            FastZip _FastZip = new FastZip();

            _FastZip.CreateZip("content.zip", "./", true, @"\.jpg|\.png|.\xml");
        }