/// <summary> /// 应用程序的主入口点。 /// </summary> static void Main(string[] args) { while (true) { var dir = @"E:\----------------SVN--------------------\Cocos_Test\assets\resources"; string savepath = null; if (args.Length >= 1) { dir = args[0]; if (args.Length >= 2) { savepath = args[1]; } } if (string.IsNullOrEmpty(savepath)) { var dirInfo = new System.IO.DirectoryInfo(dir); savepath = dirInfo.FullName; if (!savepath.EndsWith("\\")) { savepath += "\\"; } savepath += dirInfo.Name + ".zip"; } var zipCompress = new ZipCompress(dir, savepath); var task = zipCompress.StartCompressAsync(progressCallback: ProgressCallback); task.Wait(); Console.ReadKey(); } }
private void Form1_Load(object sender, EventArgs e) { var zipCompress = new ZipCompress(@"E:\----------------SVN--------------------\Cocos_Test\assets\resources" , @"E:\----------------SVN--------------------\Cocos_Test\assets\resources.zip"); zipCompress.StartCompressAsync(progressCallback: ProgressCallback); }