If VB6 you can use (sometimes have to use):

commonDialog1.MaxFileSize = "32767"

This is not acceptable in .NET, is there a way to do this in .NET? Or do I need to worry with this at all? If not please explain why.

有帮助吗?

解决方案 2

(sometimes have to use)

No, the last version of Visual Basic where that property still made sense was VB4. The last 16-bit version of VB. The kind of version where you'd still worry a bit how much storage is required to store the filenames of all the selected files when you allow the user to select multiple files.

There is no conceivable way that can be a problem on a 32-bit operating system.

其他提示

You don't have to worry about this in .NET. MaxFileSize was used in VB6 to allocate extra memory for storing lists of filenames and paths when multiple selections were enabled. This is managed dynamically by the framework in .NET when using OpenFileDialog and the like.

It definately mattered in VB 5 & 6 when you wanted to allow multiselection.

An integer specifying the maximum size of the filename in bytes. The range for this property is 1 - 32K. The default is 256.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top