Exemplo n.º 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");
            }
        }
Exemplo n.º 2
0
 public _Index(ulong ui, _Folder f)
 {
     UI     = ui;
     folder = f;
     Type   = 1;
 }