商品选品准备工作
This commit is contained in:
1 parent
dda4fdfc5f
commit
a77278c6d1
34 files changed
+2336
-48
No files matched your search
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Publish
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnPack_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<string> filePathLst = new List<string>();
|
||||
string destinationZip = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "Update.zip";
|
||||
foreach (var item in this.lstFile.Items)
|
||||
{
|
||||
filePathLst.Add(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + item.ToString());
|
||||
}
|
||||
using (ZipArchive zip = ZipFile.Open(destinationZip, ZipArchiveMode.Create))
|
||||
{
|
||||
foreach (string filePath in filePathLst)
|
||||
{
|
||||
zip.CreateEntryFromFile(filePath, Path.GetFileName(filePath), CompressionLevel.Optimal);
|
||||
}
|
||||
}
|
||||
MessageBox.Show("打包成功!");
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user