Пример #1
0
        private static void CreateDocs()
        {
            Console.Write("Crawling");
            DocManager    docManager          = new DocManager();
            string        StartTargetLocation = @"C:\Users\Life-Lich\Desktop\Use Full Classes\";
            List <string> Folders             = new Crawler().GetFolders(StartTargetLocation);
            List <Doc>    Docs = new List <Doc>();

            Console.Write("Saving To DataBases");
            foreach (var location in Folders)
            {
                List <string> fileLocation = new Crawler().GetFiles(location);
                Console.Write(",");
                if (fileLocation.Count != 0)
                {
                    docManager.CreateDocs(fileLocation);
                }
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            CreateDocs();

            DocManager docManager = new DocManager();

            ConnectionManager connectionManager = new ConnectionManager();

            //her starter vi med at finde all ordne i all docs
            List <Doc> docs = docManager.GetDocs("name = PoliceDBEntities");

            foreach (var doc in docs)
            {
                List <string> wordsInFile = new ReadFile().ReadOneFile(doc.docLocation);
                foreach (var wif in wordsInFile)
                {
                    //grunden til at jeg ikke bare insætter id et her er fordi at idet wordet har i PoliceDBEntities er ikke sikkert det sammen i PoliceDBEntities2 der for er det beder at sænde location så en søge funktion kan finde de invidelle id'er
                    connectionManager.CreateConnection(doc.docLocation, wif);
                }
            }
            Console.WriteLine("Done");
            System.Console.ReadKey();
        }