B
B
Benbenben2022-03-19 23:04:28
C++ / C#
Benbenben, 2022-03-19 23:04:28

Why C# in OpenFileDialog DocumentFormat.OpenXml?

I select a file (any extension) via OpenFileDialog => the studio complains "System.IO.FileNotFoundException: "Failed to load file or assembly "DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17" or one of their dependencies . The specified file cannot be found. => departure. How to behave and why did the studio even remember OpenXml in OFD?
The code:

private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog OFD = new OpenFileDialog();
            if (OFD.ShowDialog() == DialogResult.OK)
            {
                label1.Text = $"Исходный файл: {OFD.FileName}.";
            }
        }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question