예제 #1
0
        private void EnterPath(string name)
        {
            switch (curList)
            {
            case ListType.Computer:
                DriveInfo di = new DriveInfo(name);
                if (di.IsReady)
                {
                    curList = ListType.Dir;
                    curDir  = new DirectoryInfo(name);
                    FillList();
                }
                break;

            case ListType.Dir:
                DirectoryInfo dir = new DirectoryInfo(Path.Combine(curDir.FullName, name));
                FileInfo      fi  = new FileInfo(Path.Combine(curDir.FullName, name));
                if (dir.Exists)
                {
                    curDir = dir;
                    FillList();
                }
                else
                {
                    switch (FileDetect.Detect(fi.FullName))
                    {
                    case FileDetect.FileType.ZIP:
                        archive = new ZipFile(fi.FullName);
                        listFiles.Items.Clear();
                        curList = ListType.Package;
                        ftype   = FileDetect.FileType.ZIP;
                        FillList();
                        break;

                    case FileDetect.FileType.GZIP:
                        MessageBox.Show("gzip");
                        break;

                    case FileDetect.FileType.ISO:
                        MessageBox.Show("iso");
                        break;

                    case FileDetect.FileType.RAR:
                        MessageBox.Show("rar");
                        break;

                    case FileDetect.FileType.RAR5:
                        MessageBox.Show("5");
                        break;

                    case FileDetect.FileType.SEVENZIP:
                        MessageBox.Show("7z");
                        // SevenZip.Compression.
                        break;

                    case FileDetect.FileType.ETC:
                        Process.Start(fi.FullName);
                        break;

                    case FileDetect.FileType.ERROR:
                        MessageBox.Show("File Detect error!");
                        break;
                    }
                }
                break;

            case ListType.Package:
                break;
            }
        }
예제 #2
0
 private void EnterPath(string name)
 {
     switch (curList)
     {
     case ListType.Computer:
         DriveInfo di = new DriveInfo(name);
         if (di.IsReady)
         {
             curList = ListType.Dir;
             curDir = new DirectoryInfo(name);
             FillList();
         }
         break;
     case ListType.Dir:
         DirectoryInfo dir = new DirectoryInfo(Path.Combine(curDir.FullName, name));
         FileInfo fi = new FileInfo(Path.Combine(curDir.FullName, name));
         if (dir.Exists)
         {
             curDir = dir;
             FillList();
         }
         else
         {
             switch (FileDetect.Detect(fi.FullName))
             {
             case FileDetect.FileType.ZIP:
                 archive = new ZipFile(fi.FullName);
                 listFiles.Items.Clear();
                 curList = ListType.Package;
                 ftype = FileDetect.FileType.ZIP;
                 FillList();
                 break;
             case FileDetect.FileType.GZIP:
                 MessageBox.Show("gzip");
                 break;
             case FileDetect.FileType.ISO:
                 MessageBox.Show("iso");
                 break;
             case FileDetect.FileType.RAR:
                 MessageBox.Show("rar");
                 break;
             case FileDetect.FileType.RAR5:
                 MessageBox.Show("5");
                 break;
             case FileDetect.FileType.SEVENZIP:
                 MessageBox.Show("7z");
                 // SevenZip.Compression.
                 break;
             case FileDetect.FileType.ETC:
                 Process.Start(fi.FullName);
                 break;
             case FileDetect.FileType.ERROR:
                 MessageBox.Show("File Detect error!");
                 break;
             }
         }
         break;
     case ListType.Package:
         break;
     }
 }