Beispiel #1
0
        public static void DirSearch(string sDir)
        {
            Nfiles   = new List <string> {
            };
            Nfolders = new List <string> {
            };
            try
            {
                foreach (string f in Directory.GetFiles(sDir))
                {
                    try
                    {
                        var x = new _File(f);
                        if (!files.ContainsValue(x))
                        {
                            FileFunction.UINC++;

                            files.Add(FileFunction.UINC.ToString(), x);
                            Nfolders.Add(FileFunction.UINC.ToString());
                        }
                        else
                        {
                            string UIN = files.FirstOrDefault(files => files.Value == x).Key;
                            Nfiles.Add(UIN);
                        }
                    }
                    catch (Exception e)
                    {
                        System.Windows.Forms.MessageBox.Show("Access denied");
                    }
                }
                foreach (string d in Directory.GetDirectories(sDir))
                {
                    try
                    {
                        var x = new _Folder(d);
                        if (!folders.ContainsValue(x))
                        {
                            FileFunction.UINC++;

                            folders.Add(FileFunction.UINC.ToString(), x);
                            Nfolders.Add(FileFunction.UINC.ToString());
                        }
                        else
                        {
                            string UIN = folders.FirstOrDefault(folders => folders.Value == x).Key;
                            Nfolders.Add(UIN);
                        }
                    }
                    catch (Exception e)
                    {
                        System.Windows.Forms.MessageBox.Show("access denied");
                    }
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("access denied");
            }
        }
Beispiel #2
0
 private void browser_lv_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (browser_lv.SelectedItems.Count > 0)
     {
         if (Crawler.index.Get(browser_lv.SelectedItems[0].Name).Type == 0)
         {
             _File file = Crawler.index.Get(browser_lv.SelectedItems[0].Name).file;
             fileinfo_lb.Text = "Name: " + file.Name + "\nLocation: " + file.Location + "\nSize: " + file.size + "\nLast Access: " + file.Lastaccess;
         }
     }
 }
Beispiel #3
0
 public _Index(ulong ui, _File f)
 {
     UI   = ui;
     file = f;
     Type = 0;
 }