Example #1
0
        public void PreMakeDir()
        {
            DirectoryInfo directory = new DirectoryInfo(Source_FBDResults);
            DirectoryInfo DestDir   = new DirectoryInfo(Dest_FBDResults);

            DirectoryInfo[] DList = directory.GetDirectories("*", SearchOption.AllDirectories);
            foreach (var D in DList)
            {
                string D2 = D.FullName;

                string D3 = D2.Replace(directory.ToString(), DestDir.ToString());

                string D4 = D2.Replace(directory.ToString(), "");

                DirectoryInfo mdir = new DirectoryInfo(D3);

                mdir.Create();

                RTBOutput.AppendText(Environment.NewLine + D2 + " making " + D3);
                RTBOutput.ScrollToEnd();
                CComplet = CComplet + 1;
                TB_CompletedCount.Text = CComplet.ToString();
                MainPB.Value           = CComplet;
            }
        }
Example #2
0
        public void copyer(string ffname, string fname)
        {
            DirectoryInfo DestDir   = new DirectoryInfo(Dest_FBDResults);
            DirectoryInfo SorceDir  = new DirectoryInfo(Source_FBDResults);
            string        SNameDir1 = ffname.Replace(fname, "");
            string        SNamedir2 = SNameDir1.Replace(SorceDir.ToString(), DestDir.ToString());
            string        NFName    = SNamedir2 + fname;

            if (System.IO.Directory.Exists(SNamedir2))
            {
                System.IO.File.Copy(ffname, NFName, Overwrite);
                RTBOutput.AppendText(Environment.NewLine + ffname + " Copy to " + NFName);
            }
        }
Example #3
0
        public void CopyMashine()
        {
            PBPrep();

            DateTime CurrentTime = DateTime.Now;

            TB_StartTime.Text = CurrentTime.ToString();

            if (CB_Recursive.IsChecked == true)
            {
                DirectoryInfo directory = new DirectoryInfo(Source_FBDResults);
                FileInfo[]    files     = directory.GetFiles("*.*", SearchOption.AllDirectories);

                PreMakeDir();

                foreach (var f in files)
                {
                    var f2 = f.FullName;

                    copyer(f2.ToString(), f.ToString());

                    //RTBOutput.AppendText(Environment.NewLine + f2);
                    RTBOutput.ScrollToEnd();
                    CComplet = CComplet + 1;
                    TB_CompletedCount.Text = CComplet.ToString();
                    MainPB.Value           = CComplet;
                }
            }
            else
            {
                DirectoryInfo directory = new DirectoryInfo(Source_FBDResults);
                FileInfo[]    files     = directory.GetFiles("*.*", SearchOption.TopDirectoryOnly);
                foreach (var f in files)
                {
                    var f2 = f.FullName;

                    copyer(f2.ToString(), f.ToString());

                    //RTBOutput.AppendText(Environment.NewLine + f2);
                    RTBOutput.ScrollToEnd();
                    CComplet = CComplet + 1;
                    TB_CompletedCount.Text = CComplet.ToString();
                    MainPB.Value           = CComplet;
                }
            }
        }
Example #4
0
        public void Filecount()
        {
            if (CB_Recursive.IsChecked == true)
            {
                try
                {
                    SDirCount  = Directory.GetFiles(Source_FBDResults, "*.*", SearchOption.AllDirectories).Length;
                    DirCount   = Directory.GetDirectories(Source_FBDResults, "*", SearchOption.AllDirectories).Length;
                    totelCount = SDirCount + DirCount;
                }
                catch (UnauthorizedAccessException)
                {
                    string logMsg = string.Format("Unable to access directory {0}", Source_FBDResults);
                    RTBOutput.AppendText(Environment.NewLine + logMsg);
                    RTBOutput.AppendText(Environment.NewLine + "Please try Running me as Adminstrator");
                }
                catch (ArgumentNullException)
                {
                }
            }
            else
            {
                try
                {
                    totelCount = Directory.GetFiles(Source_FBDResults, "*.*", SearchOption.TopDirectoryOnly).Length;
                }
                catch (UnauthorizedAccessException)
                {
                    string logMsg = string.Format("Unable to access all the files in directory {0}", Source_FBDResults);
                    RTBOutput.AppendText(Environment.NewLine + logMsg);
                    RTBOutput.AppendText(Environment.NewLine + "Please try Running me as Adminstrator");
                }
                catch (ArgumentNullException)
                {
                }
            }

            TBFileCount.Text = totelCount.ToString();
        }
Example #5
0
 private void WarrningMessage()
 {
     RTBOutput.AppendText(Environment.NewLine + "You Hit the Big Red Button!! Do you know what you just DID?");
     RTBOutput.AppendText(Environment.NewLine + "Begining the File Copy Proccess ... ");
     RTBOutput.AppendText(Environment.NewLine + "Please Wait for the Proccess to Finish");
 }