Ejemplo n.º 1
0
 public static void CheckConnection()
 {
     try
     {
         DFLib df = new DFLib();
         Console.WriteLine(df.CheckConnection());
     }
     catch (Exception exp)
     {
         DFLib.LogError(exp.Message);
     }
 }
Ejemplo n.º 2
0
 public static void ClearDatabase()
 {
     try
     {
         DFLib df = new DFLib();
         df.RemoveAllData();
         Console.WriteLine("---Records successfully removed from database---");
     }
     catch (Exception exp)
     {
         DFLib.LogError(exp.Message);
     }
 }
Ejemplo n.º 3
0
        public static void Delete(string line)
        {
            var maxDegreeOfParallelism = int.Parse(ParseArgument(line, "-parallel") ?? "1");

            try
            {
                DFLib df = new DFLib();
                df.DeleteFiles(maxDegreeOfParallelism);
            }
            catch (Exception exp)
            {
                DFLib.LogError(exp.Message);
            }
        }
Ejemplo n.º 4
0
        public static void Scan(string line)
        {
            try
            {
                var searchPattern          = ParseArgument(line, "-pattern");
                var paths                  = ParseArgument(line, "-target").Split(',');
                var maxDegreeOfParallelism = ParseArgument(line, "-parallel") ?? "1";

                DFLib df = new DFLib();
                foreach (var path in paths)
                {
                    df.StartScan(path, searchPattern, int.Parse(maxDegreeOfParallelism));
                }
                Console.WriteLine("---Scan Complete---");
            }
            catch (Exception exp)
            {
                DFLib.LogError(exp.Message);
            }
        }