1

我有一个小助手应用程序,用于将脚本“注入”到 html 页面中。

我有一个 openfiledialog 提示,我选择了该目录中的所有 html 文件(1403 个文件),无论我做什么,我都看到 OFD.filenames.count = 776

有限制吗?

谢谢

OpenFileDialog OFD = new OpenFileDialog();
            OFD.Multiselect = true;
            OFD.Filter = "HTML Files (*.htm*)|*.HTM*|" +
          "All files (*.*)|*.*";

            if (OFD.ShowDialog() == DialogResult.OK)
            {
                progressBar1.Maximum = OFD.FileNames.Count();
                foreach (string s in OFD.FileNames)
                {
                    Console.WriteLine(s);
                    AddAnalytics(s);
                    progressBar1.Value++;
                }
                MessageBox.Show(string.Format("Done! \r\n {0} files completed",progressBar1.Value));
                progressBar1.Value = 0;
            }
4

1 回答 1

3

OpenFileDialog 将仅使用“文件名”字段中的前 256 个字符。该字段本身显示更多​​,但它忽略了 256 个字符之后的任何内容。

我相信在您的情况下,丢失的文件列在 256 个字符标记之后。

于 2009-08-27T03:12:57.427 回答