close

     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;


        }

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 11 的頭像
    11

    冠霖的部落格

    11 發表在 痞客邦 留言(0) 人氣()