首先,需要安装7Z软件,以下是安装在C盘
以下是具体代码:
//组成新的路径
string path0 = System.Windows.Forms.Application.StartupPath + "\\ausu\\";
//判断该路径下文件夹是否存在,不存在的情况下新建文件夹
if (!Directory.Exists(path0))
{
Directory.CreateDirectory(path0);
}
string FileNameZ = BillID.Substring(0, BillID.IndexOf('.') - 5) + ".csv";
string FileNameGZ = BillID.Substring(0, BillID.IndexOf('.') - 5) + ".gz";
string strFilePath = path0 + FileNameZ;
string desFilePath = path0 + BillID.Substring(0, BillID.IndexOf('.