Beispiel #1
0
        public FileHashComputer(ref ManagedQueue <FileQueueItem> fileQueue, ref ManagedQueue <DbQueueItem> hashQueue)
        {
            this.fileQueue = fileQueue;
            this.hashQueue = hashQueue;

            activeComputeHashThreads = 0;
        }
Beispiel #2
0
        public DB(string dataSource, string initialCatalog, ref ManagedQueue <DbQueueItem> hashQueue)
        {
            var connectionString = new SqlConnectionStringBuilder();

            connectionString.DataSource         = dataSource;
            connectionString.InitialCatalog     = initialCatalog;
            connectionString.IntegratedSecurity = true;
            conn    = new SqlConnection(connectionString.ToString());
            command = new SqlCommand {
                Connection = conn
            };
            this.hashQueue = hashQueue;
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            fileQueue = new ManagedQueue <FileQueueItem>();
            hashQueue = new ManagedQueue <DbQueueItem>();

            DB db = new DB(args[0], args[1], ref hashQueue);

            db.Connect();

            PathScanner pathScanner = new PathScanner(ref fileQueue);

            pathScanner.StartAsyncScan(args.Skip(3).ToArray());

            FileHashComputer hashComputer = new FileHashComputer(ref fileQueue, ref hashQueue);

            hashComputer.StartAsyncHashComputer(Convert.ToUInt32(args[2]));

            db.StartAsyncThread();

            Console.ReadLine();
        }
Beispiel #4
0
 public PathScanner(ref ManagedQueue <FileQueueItem> fileQueue)
 {
     this.fileQueue = fileQueue;
 }