我有一个小助手应用程序,我用它来“注入”脚本到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;
}发布于 2009-08-27 03:12:57
OpenFileDialog将只使用‘文件名’字段中的前256个字符。字段本身会显示更多内容,但它会忽略256个字符之后的所有内容。
我相信在您的情况下,缺少的文件列在256个字符标记之后。
https://stackoverflow.com/questions/1338659
复制相似问题