示例#1
0
        public void execute(string phoneId,string zipPath,string pass)
        {
            DBManager dbm = new DBManager();

            try
            {
                string res = dbm.saveFile(phoneId, Path.GetFileName(zipPath), false, true, new FileInfo(zipPath).Length);

                if (res == "OK.")
                {

                    ZipManager zm = new ZipManager();
                    zm.descomprimirDir(zipPath, pass, Path.GetDirectoryName(zipPath), new ZipLog());

                    string[] files = Directory.GetFiles(Path.GetDirectoryName(zipPath), "*.txt", SearchOption.TopDirectoryOnly);

                    for (int i = 0; (i < files.Length) && (res == "OK."); i++)
                    {
                        this.processFile(phoneId, files[i], dbm);
                        File.Delete(files[i]);
                    }

                    if (res == "OK.")
                        dbm.saveFile(phoneId, Path.GetFileName(zipPath), true, true, new FileInfo(zipPath).Length);
                }
            }
            catch (Exception ex)
            {
                dbm.saveFile(phoneId, Path.GetFileName(zipPath), false, true, new FileInfo(zipPath).Length);
            }
        }