110,534
社区成员
发帖
与我相关
我的任务
分享
可直接使用winrar加密压缩文件
string strtxtPath = "C:\\A\\1.txt";
string strzipPath = "C:\\B\\1.zip";
System.Diagnostics.Process Process1 = new System.Diagnostics.Process();
Process1.StartInfo.FileName = "Winrar.exe";
Process1.StartInfo.CreateNoWindow = true;
Process1.StartInfo.Arguments = " a -r "+strzipPath+" " + strtxtPath ;
Process1.StartInfo.Arguments = " a -ep " + strzipPath + " " + strtxtPath;
////加密压缩c
Process1.StartInfo.Arguments = " a -p123456 " + strzipPath + " " + strtxtPath;
Process1.Start();
if (Process1.HasExited)
{
int iExitCode = Process1.ExitCode;
if (iExitCode == 0)
{
Response.Write(iExitCode.ToString() + " 完成");
}
else
{
Response.Write(iExitCode.ToString() + " 有错");
}
}