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

Asked

Viewed 112 times

8

Well, I’m using the openfiledialog to open files, however the software needs to receive files or folders, because it compressed and zipped (.zip) and then make a symmetrical cipher.

I have searched several sites and the like, and I haven’t found 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);

1 answer

6


  • Well, thank you very much, I really wasted a lot of time thinking I could do it by native means.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.