.NET OpenFileDialog限制 [英] .NET OpenFileDialog Limit
问题描述
我正在尝试使用.NET OpenFileDialog一次选择最多1100个文件(这是必需的!).
当文件的一定顺序选择(约150-200文件)和OK按钮被击中,应用程序崩溃与选取了太多的文件.请选择较少的文件"的错误消息.
在MSDN上,我已经看到OpenFileDialog限制为200个文件.这没有任何意义,因为我可以选择所有1100个文件而没有任何问题.
我还读到分配给文件的缓冲区不够大,但是不可能增加缓冲区的大小?
有谁知道我必须能够在OpenFileDialog中选择最多1100个选项,或者使用其他控件?
:thumbsup:
[已删除c ++标记-Rajesh]
I am trying to use the .NET OpenFileDialog to select upto 1100 files at one time (this is a requirement!).
When a certain sequence of files are selected (approximately 150-200 files) and the OK button is hit, the application crashes with a "Too many files selected. Please select fewer files" error message.
Looking on MSDN, I have seen that OpenFileDialog has a limit of 200 files. This does not make sense as I am able to select all 1100 files without any issues.
I have also read that the buffer assigned to contain the files isn''t big enough but that it isn''t possible to increase the buffer size?
Does anyone know the options I have to be able to selected upto 1100 in an OpenFileDialog or maybe using a different control?
:thumbsup:
[Removed c++ tag - Rajesh]
推荐答案
一个不错的选择是将所有文件名放在文本文件中,然后接受文本文件作为程序的输入.
A good alternative could be to put all file names in a text file, and then accept that text file as your program''s input.
我发现了这个线程,它建议使用Windows API GetOpenFileName,您可以更改它的大小. >
http://www.dotnet247.com/247reference/msgs/17/86277.aspx [ ^ ]
I found this thread, it suggests using the windows API GetOpenFileName, which you can change the size of unlike the .NET version.
http://www.dotnet247.com/247reference/msgs/17/86277.aspx[^]
您应该允许用户选择目录.然后列出所有文件,并让它们选择尽可能多的文件,这不会有任何问题.
我说的是与设计ftp客户端相同的方式.
http://screenshots.en.softonic.com/en/scrn/40000/40069/3_fireftp1.jpg [ ^ ]
You should allow user to pick the directory. Then you list all the files and let them select as many files, there will not be any problem.
I am talking the same way as ftp clients are designed.
http://screenshots.en.softonic.com/en/scrn/40000/40069/3_fireftp1.jpg[^]
这篇关于.NET OpenFileDialog限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!