ArchiveLoadOptions.DecryptionPassword

ArchiveLoadOptions.DecryptionPassword property

डिक्रिप्ट प्रविष्टियों के लिए पासवर्ड प्राप्त करता है या सेट करता है।

public string DecryptionPassword { get; set; }

उदाहरण

आप आर्काइव निष्कर्षण पर एक बार डिक्रिप्शन पासवर्ड प्रदान कर सकते हैं।

using (FileStream fs = File.OpenRead("encrypted_archive.zip"))
{
    using (var extracted = File.Create("extracted.bin"))
    {
        using (Archive archive = new Archive(fs, new ArchiveLoadOptions() { DecryptionPassword = "p@s$" }))
        {
            using (var decompressed = archive.Entries[0].Open())
            {
                byte[] b = new byte[8192];
                int bytesRead;
                while (0 < (bytesRead = decompressed.Read(b, 0, b.Length)))
                    extracted.Write(b, 0, bytesRead);
                
            }
        }
    }
}

यह सभी देखें