C#.net中的ICSharpCode [英] ICSharpCode in C#.net

查看:45
本文介绍了C#.net中的ICSharpCode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,
我正在使用ICharpcode在我的项目中创建一个zip文件.
这是我的代码

 字符串 l_oZipPath;
l_oZipPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)+  @"  + " ;
ICSharpCode.SharpZipLib.Zip.FastZip z =  ICSharpCode.SharpZipLib.Zip.FastZip();
z.CreateEmptyDirectories =  true ;
z.CreateZip(l_oZipPath +  @"  + DateTime.Now.ToString(  yyyy_MM_dd_HH_mm_ss")+  ,Program.SourceDirName,"  txt"); 


在这里,
Program.SourceDirName是目录名称.
目录中的三个文本文件. File1,File2,File3.我只想压缩File3.如何使用ICharpCode做到这一点?请帮助我.

解决方案

您应该只需能够在CreateZip末尾的过滤器中将"txt"替换为"File3.txt"即可提取该文件. /blockquote>

嗨皮特,
感谢您的答复.


Hi friends,
I am using ICharpcode for creating a zip file in my Project.
This is my code

String l_oZipPath;
l_oZipPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + "TestingZip";
ICSharpCode.SharpZipLib.Zip.FastZip z = new ICSharpCode.SharpZipLib.Zip.FastZip();
z.CreateEmptyDirectories = true;
z.CreateZip(l_oZipPath + @"\" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".zip", Program.SourceDirName, false, "txt");


Here,
Program.SourceDirName is a Directory Name.
Three Text file in the Directory. File1,File2,File3 .I want to zip a File3 only.How can i achieve this using ICharpCode? Please Help me.

解决方案

You should simply be able to replace "txt" with "File3.txt" in the filter at the end of CreateZip to pick that file up.


Hi Pete ,
Thanks for your reply.


这篇关于C#.net中的ICSharpCode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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