Esempio n. 1
0
        public static void copyDir(string rDir, string wDir)
        {
            Queue <string> dirq = new Queue <string>();

            dirq.Enqueue(rDir);
            dirq.Enqueue(wDir);

            while (1 <= dirq.Count)
            {
                rDir = dirq.Dequeue();
                wDir = dirq.Dequeue();

                Directory.CreateDirectory(wDir);

                foreach (string dir in FileTools.lsDirs(rDir))
                {
                    dirq.Enqueue(dir);
                    dirq.Enqueue(Path.Combine(wDir, Path.GetFileName(dir)));
                }
                foreach (string file in FileTools.lsFiles(rDir))
                {
                    File.Copy(file, Path.Combine(wDir, Path.GetFileName(file)));
                }
            }
        }
Esempio n. 2
0
            private void getMessageRange()
            {
                _gmrFirstNo = -1;
                _gmrLastNo  = -1;

                if (Directory.Exists(_messageDir) == false)
                {
                    return;
                }

                foreach (string file in FileTools.lsFiles(_messageDir))
                {
                    string lFile = Path.GetFileName(file);
                    int    no    = int.Parse(lFile);

                    if (_gmrFirstNo == -1)
                    {
                        _gmrFirstNo = no;
                    }
                    else
                    {
                        _gmrFirstNo = Math.Min(_gmrFirstNo, no);
                    }

                    _gmrLastNo = Math.Max(_gmrLastNo, no);
                }
            }