static void Main(string[] args)
        {
            string commandInput = string.Empty;
            int    RawReturn    = -1;

            SharedLibrary.RawData     RawNMap     = new RawData();
            SharedLibrary.StoreIndex  CaptureData = new StoreIndex();
            SqlInterface.SqlInterface SqlDatabase = new SqlInterface.SqlInterface("127.0.0.1",
                                                                                  "nmapanalysistool",
                                                                                  "root", "root");

            Console.Write("nMap Options:");
            commandInput = Console.ReadLine();

            while (commandInput.ToUpper().CompareTo("STOP") != 0)
            {
                RawNMap = new RawData(commandInput);

                while ((RawReturn = RawNMap.ReadRawLine()) != -1)
                {
                    StoreIndex.InsertType InsertOption = (StoreIndex.InsertType)RawReturn;

                    CaptureData.Add(RawNMap, InsertOption);
                }

                Console.Write("\nnMap Options:");
                commandInput = Console.ReadLine();
            }

            SqlDatabase.QueryIPLists(CaptureData.GetTreeRoot);

            Console.WriteLine("All entries have been entered to database");
            Console.ReadLine();
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            List <StoreIndex> list = new List <StoreIndex>();

            foreach (Store store in database.Stores.ToList())
            {
                StoreIndex storeIndex = new StoreIndex(store);
                foreach (Link link in database.Links.ToList())
                {
                    if (link.StoreID == store.Id)
                    {
                        storeIndex.BookCounter++;
                    }
                }
                list.Add(storeIndex);
            }
            return(View(list));
        }