public static bool File2RAR(string strORGPath, string strZIPPath)
{
bool rc = false;
try
{
System.Diagnostics.Process Process1 = new System.Diagnostics.Process();
Process1.StartInfo.FileName = "Winrar.exe";
Process1.StartInfo.CreateNoWindow = true;
Process1.StartInfo.Arguments = " a -p12345678 -r " + strZIPPath + " " + strORGPath; //解壓縮密碼12345678
Process1.Start();
rc = true;
System.Threading.Thread.Sleep(4000);// SLEEP 4秒....若馬上寄信附件會找不到,因壓縮未完成
}
catch (Exception)
{
rc = false;
}
return rc;
}
留言列表