OpenFileDialog.Filenames 有限制吗?
我有一个小助手应用程序,用于将脚本“注入”到 html 页面中。
我有一个 openfiledialog promt,我选择该目录中的所有 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;
}
I have a small helper app that I use to "inject" scripts into html pages.
I have an openfiledialog promt and i select all the html files in that directory (1403 files) and no matter what i do i see that OFD.filenames.count = 776
is there a limit?
thanks
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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
OpenFileDialog 将仅使用“文件名”字段中的前 256 个字符。该字段本身显示更多内容,但它会忽略 256 个字符之后的任何内容。
我相信在您的情况下,丢失的文件会在 256 个字符标记之后列出。
The OpenFileDialog will only use the first 256 characters in the 'file name' field. The field itself displays more, but it ignores anything after the 256 characters.
I believe in your case the missing files are listed after the 256 character mark.