使用Windows窗体上载和下载文件 [英] Upload and download files using Windows form

查看:102
本文介绍了使用Windows窗体上载和下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始开发与桌面应用程序相关的项目。但我有一个表单,用户必须上传与项目相关的文件,虽然我怀疑这些文件是应该上传到SQL Server中的数据库还是服务器上的文件夹,

其他任何其他想法?

I'm starting to develop a desktop application related projects. But I have a form where the user has to upload files related to the project, although I doubt if the files should be uploaded to the database in SQL Server or in a folder on the server,
any other ideas?

推荐答案

这里重要的问题是这些文件的大小。请参阅Microsoft的这项研究: BLOB或不BLOB:数据库中的大对象存储或文件系统? [ ^ ]

如果有问题的文件大于250kB,那么SQL Server会在性能方面获胜。如果它们是1MB或更大,则文件系统在性能方面获胜。如果你要将它们存储在Filesystem上,你应该通过Filestreams的SQL-Server功能来实现 - 这样,操作就可以成为事务的一部分:

FILESTREAM概述 [ ^ ]

开始使用FILESTREAM存储 [ ^ ]



编辑:250kB到1MB之间没有明确的赢家。

您也可以考虑数据库备份。如果将文件存储在文件系统上,则数据库备份大小可能会小得多。



Edit2:关于使用文件流的CodeProject文章:

网站:codeproject.com filestream - Google搜索 [ ^ ]
The important question here is how large these files would be. Please see this study by Microsoft: To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem?[^]
If the files in question are not larger than roughly 250kB then SQL Server wins performance-wise. If they're 1MB or larger, then the Filesystem wins performance-wise. If you'll be storing them on the Filesystem, you should do it via the SQL-Server feature of Filestreams - that way, the operations can be part of transactions:
FILESTREAM Overview[^]
Getting Started with FILESTREAM Storage[^]

Between 250kB and 1MB there's no clear "winner".
And you may also take database-backup into consideration. If you store the files on the filesystem the database backup size would probably be a lot smaller.

CodeProject articles on using Filestreams:
site:codeproject.com filestream - Google Search[^]


这篇关于使用Windows窗体上载和下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆