示例#1
0
        protected virtual int OnPasswordRequired(IntPtr p1, int p2)
        {
            int num = -1;

            if (this.PasswordRequired == null)
            {
                throw new IOException("Password is required for extraction.");
            }
            PasswordRequiredEventArgs e = new PasswordRequiredEventArgs();

            this.PasswordRequired(this, e);
            if (!e.ContinueOperation || (e.Password.Length <= 0))
            {
                return(num);
            }
            for (int i = 0; (i < e.Password.Length) && (i < p2); i++)
            {
                Marshal.WriteByte(p1, i, (byte)e.Password[i]);
            }
            Marshal.WriteByte(p1, e.Password.Length, 0);
            return(1);
        }
示例#2
0
 private void unrar_PasswordRequired(object sender, PasswordRequiredEventArgs e)
 {
     MessageBox.Show("Password is required for extraction.");
     e.ContinueOperation = false;
 }