TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
amritha O
NA
16
24.7k
Zip multiple files then save to a shared location
Jun 24 2020 1:37 AM
Hi
Im trying to zip some excel and xml files using c# using ionic.zip dll
ZipFile zip =
new
ZipFile();
zip.AlternateEncodingUsage = ZipOption.AsNecessary;
zip.AddDirectoryByName(
"Files"
);
foreach
(
string
filepath
in
folderPaths)
{
zip.AddFile(filepath,
"Files"
);
}
string
zipName = String.Format(
"Zip_{0}.zip"
, DateTime.Now.ToString(
"yyyy-MMM-dd-HHmmss"
));
zip.Save(Path.Combine(folderPath, zipName));
foreach
(
string
filepath
in
folderPaths)
{
if
((System.IO.File.Exists(Path.Combine(filepath))))
{
System.IO.File.Delete(Path.Combine(filepath));
}
}
above code works well but issue is a directory name files inside zip folder i want to remove this
when i remove zip.AddDirectoryByName("Files"); this code a folder with folderPath creatind instead of files .How to remove this .How files directly coming under zip folder
Reply
Answers (
1
)
Login and Registration api in .net core.
How to POST Request using Postman with visual studio