我如何在Visual Basic 2010中压缩和提取JAR文件 [英] How do i compress and extract a JAR file in Visual basic 2010

查看:75
本文介绍了我如何在Visual Basic 2010中压缩和提取JAR文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有一个简短的问题

如何使用visual basic 2010提取JAR文件

如何压缩一个?

Hello I got a short question
How do I extract a JAR file with visual basic 2010
And how do I compress one?

推荐答案

JAR文件实际上是ZIP。如果你的问题只是关于压缩,你可以使用两个开源解决方案中的一个:



你可以使用#ziplib:

http://www.icsharpcode.net/opensource/sharpziplib/ [ ^ ]。



另一个选择是使用SevenZipSharp,一个着名的7-Zip的.NET包装器:

http ://en.wikipedia.org/wiki/7-Zip [ ^ ],

http://sevenzipsharp.codeplex.com/ [< a href =http://sevenzipsharp.codeplex.com/target =_ blanktitle =New Window> ^ ]。



-SA
JAR file is actually ZIP. If your question is just about compressing, you can use one of the two open-source solutions:

You can use #ziplib:
http://www.icsharpcode.net/opensource/sharpziplib/[^].

Another option is using SevenZipSharp, a .NET wrapper of the famous 7-Zip:
http://en.wikipedia.org/wiki/7-Zip[^],
http://sevenzipsharp.codeplex.com/[^].

—SA


我在Sergey Alexandrovich Kryukov的帮助下解决了这个问题。

他是一个人我认为JAR文件与ZIP相同,所以我用这段代码来提取我的JAR。



I solved the question after a bit of help from Sergey Alexandrovich Kryukov.
He said that JAR Files are the same as ZIP so I used this code to extract my JAR.

Dim cur As String = (Environment.CurrentDirectory)
       Dim MC_JAR As String = install_path.Text & "\bin\minecraft.jar"
       Dim TEMP_FOLDER As String = cur & "\Install_Data\temp\minecraft.zip"
       System.IO.File.Copy(MC_JAR, TEMP_FOLDER)
       Dim sc_1 As New Shell32.Shell()
       Dim output_1 As Shell32.Folder = sc_1.NameSpace(cur & "\Install_Data\temp")
       Dim input_1 As Shell32.Folder = sc_1.NameSpace(cur & "\Install_Data\temp\minecraft.zip")
       output_1.CopyHere(input_1.Items, 4)
       System.IO.File.Delete(cur & "\Install_Data\temp\minecraft.zip")
       MsgBox("Disassemble complete!")







此代码将jar复制到临时文件夹,然后将其复制为zip文件,然后从zip中提取所有数据,它将删除zip文件并提供给用户消息已完成。




This code copys the jar to a temp folder and it will copy it as a zip file then it will extract all data from the zip and it will remove the zip file and give the user a message that it is done.


这篇关于我如何在Visual Basic 2010中压缩和提取JAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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