使用VB.Net对文件进行Winzipping [英] Winzipping a file using VB.Net

查看:71
本文介绍了使用VB.Net对文件进行Winzipping的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在文件夹c:\ temp中有一个名为Value.TXT的文件。我想自动winzip这个文件。如何/通过VB.Net winzip这个文件的最佳方式是什么?

解决方案

你好,



OriginalGriff的答案是正确的,但 ZipFile 类只能从.NET 4.5中获得,所以如果你不使用.NET 4.5,你应该使用第三方库例如:

SharpZipLib [ ^ ]

DotNetZip [ ^ ]


< blockquote>如果这是真正的VB.NET,那么我不推荐它 - 要么文件将被大量用户无限地写入,要么它将位于客户端PC上,你的VB代码无法访问它。



如果这是一个WinForms VB应用程序,那么它非常简单: MSDN:ZipFile类 [ ^ ]包含一个示例。


Hi,

I have a file in the folder c:\temp called Value.TXT. I want to winzip this file automatically. How/what is the best way to winzip this file via VB.Net

解决方案

Hi,

The answer of OriginalGriff is correct, but the ZipFile class is only available from .NET 4.5, so if you don't use .NET 4.5, you should use a 3rd party library such as:
SharpZipLib[^]
DotNetZip[^]


If this is truly VB.NET then I wouldn't recommend it - either the file will be pottentially written by a large number of users, or it will be located on a client PC where your VB code can't get access to it.

If this is a WinForms VB application, then it's pretty simple: MSDN: ZipFile class[^] includes an example.


这篇关于使用VB.Net对文件进行Winzipping的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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