在服务器应用程序中使用 windowsbase.dll 中的 system.io.packaging.zippackage
在服务器应用程序中,我需要能够处理 zip 文件。我有 system.io.packaging.zippackage 以前在客户端应用程序中使用过 windowsbase.dll,它似乎做得很好。我想在服务器应用程序中使用它以避免依赖第三方包。然而,在服务器应用程序中使用 WindowsBase.dll 中的某些内容让我有点紧张,因为这个 dll 是作为 WPF 的一部分发布的,人们可能会觉得它只是为了在 GUI 应用程序中使用而设计的。
那么,system.io.packaging.zippackage 在服务器应用程序中使用安全吗?是否有任何原因将其放置在 WindowsBase.dll 中而不是更通用的 dll(例如 System.dll 或类似的)中。
谢谢,
罗布
In a server application I need to be able to process a zip file. I've system.io.packaging.zippackage from windowsbase.dll in client base applications before now and it seems to do the job quite nicely. I'd like use this in a server app to avoid taking a dependency on a third party package. However, using something from a WindowsBase.dll in a server app makes me slight nervous because this dll was released as part of WPF one could get the impression that this was only indented to be used in GUI apps.
So, is system.io.packaging.zippackage safe to use in a server app? Is there any reason that it was placed in WindowsBase.dll rather than a more general dll, say System.dll or similar.
Thanks,
Rob
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在服务器上使用它通常是安全的,特别是如果您想要做的只是利用 ZipPackage 支持。您应该意识到可能存在线程安全问题(例如两个请求尝试访问同一存档),但如果您正在执行诸如压缩某些文件以发送到浏览器之类的操作,那么应该没问题。
It is generally safe to use on the server, particularly if all that you are trying to do is take advantage of the ZipPackage support. You should be aware that there could be thread safety issues (like two requests trying to access the same archive) but if you are doing something like zipping up some files to send to the browser you should be just fine.