Can you use a dialog to open both folders and files?

8

Well, I'm using openfiledialog to open files, but the software needs to receive files or folders, because it compresses and zips ( .zip ) to then make a symmetric cipher.

I searched through a number of sites and the like, and I did not find a way to use the same dialog to open both types.

private void btn_criptografar_Click(object sender, EventArgs e)
    {
        //Abre o dialogo para abrir arquivos e pastas.
        if (openFileCrypt.ShowDialog() == System.Windows.Forms.DialogResult.OK)
        {
            textBoxShowPath.Text = openFileCrypt.FileName;

            FileStream inStream = File.OpenRead(textBoxShowPath.Text);
    
asked by anonymous 21.12.2015 / 14:22

1 answer

5

Not possible on the default control. You have to develop a new one that does this. It has a example of how it can be in a library that works just with zip files ( isolated project ).

Another project that does the same .

    
21.12.2015 / 14:29