Example #1
0
 protected void MakeDir()
 {
     /*
      * if(fi.getP().Contains(".zip"))
      *
      * new   ZippedFolder(fi.getP()).CreateFolder("new folder");
      *
      * else
      * FolderMethods.CreateDirectory(fi.getP() + "\\new_folder");
      */
     Factory.Get(fi.getP()).createFolder();
 }
Example #2
0
        protected void updateList()
        {
            if (fi.getP() == "" || fi.getP().Length <= 2)
            {
                listView1.Items.Clear();
                DriveInfo[] drives = DriveInfo.GetDrives();
                foreach (DriveInfo i in drives)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.ImageIndex = 2;
                    lvi.Text       = i.Name;
                    lvi.Tag        = "directory";
                    listView1.Items.Add(lvi);
                }
                fi.obnull();
                richTextBox1.Text = "DISKS";
                return;
            }
            try
            {
                listView1.Items.Clear();

                DirectoryInfo   dInf = new DirectoryInfo(fi.getP());
                DirectoryInfo[] dMas = dInf.GetDirectories();
                FileInfo[]      fMas = dInf.GetFiles();

                foreach (DirectoryInfo i in dMas)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.ImageIndex = 1;
                    lvi.Text       = i.Name;
                    lvi.Tag        = "directory";
                    listView1.Items.Add(lvi);
                }

                foreach (FileInfo i in fMas)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.ImageIndex = 0;
                    lvi.Text       = i.Name;
                    lvi.Tag        = "file";
                    listView1.Items.Add(lvi);
                }
                richTextBox1.Text = fi.getP();
            }
            catch (Exception) { }
        }