0

System.IO.Compression を使用して C# を使用して zip ファイルを圧縮しているときに、% を取得する必要があります。私はこのコードを持っています:

if (isDirectory) {
                    Invoke(new RefreshConsoleEncryptionDel(RefreshConsoleEncryption), "[+]Wait, compressing folder...");
                    ZipFile.CreateFromDirectory(FileName, FileName + "_DirEnc.zip");
                    Invoke(new RefreshProcessBar1Del(RefreshProcessBar1), 100);
                    Invoke(new RefreshConsoleEncryptionDel(RefreshConsoleEncryption), "[✓]COMPLETED");
                    Invoke(new RefreshConsoleEncryptionDel(RefreshConsoleEncryption), "[K]Starting encrypting file...");

                    byte[] BytePasswordArray = IsFile ? File.ReadAllBytes(Password) : Encoding.UTF8.GetBytes(Password); // We create the array who will contain all bytes of password, depending if its an file password or just a string; 
                                                                                                                        // A simple ternary condition, who checks if is file or string password 
                    FileEncryptProcess(5000000, FileName + "_DirEnc.zip", BytePasswordArray); // We call the function to encrypt the file. 
                                                                              // If all goes allright we continue, else this thread will be aborted and we cant continue to next line. 
                    Thread.CurrentThread.Abort();// If we can continue, then all will be allright and we close this thread succesfully.


                }

そして、Zip 圧縮のパーセンテージで ProgressBar1 を更新する必要があります。可能です?

4

0 に答える 0