<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

           public void RARsave(string rarPatch, string rarFiles,string  patch,string rarName)
            {
                String the_rar;
                RegistryKey the_Reg;
                Object the_Obj;
                String the_Info;
                ProcessStartInfo the_StartInfo;
                Process the_Process;
                try
                {
                    the_Reg = Registry.ClassesRoot.OpenSubKey(@"Applications\\WinRAR.exe\\Shell\\Open\\Command");
                    the_Obj = the_Reg.GetValue("");
                    the_rar = the_Obj.ToString();
                    the_Reg.Close();
                    the_rar = the_rar.Substring(1, the_rar.Length - 7);
                    if (!Directory.Exists(patch))
                    Directory.CreateDirectory(patch);
                    //命令參數

                    //the_Info = " a  c:\\test.rar a.txt -r"; //文件壓縮

                    the_Info = string.Format(" a -df {0}\\{1}  {2}  -r", patch, rarName, rarFiles);// " a " + rarName + " " + patch;
                    the_StartInfo = new ProcessStartInfo();
                    the_StartInfo.FileName = the_rar;
                    the_StartInfo.Arguments = the_Info;
                    the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                    //打包文件存放目錄

                    the_StartInfo.WorkingDirectory = rarPatch;
                    the_Process = new Process();
                    the_Process.StartInfo = the_StartInfo;
                    the_Process.Start();
                    the_Process.WaitForExit();
                    the_Process.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            public string unRAR(string rarPath, string rarName, string unRarPath)
            {
                String the_rar;
                RegistryKey the_Reg;
                Object the_Obj;
                String the_Info;
                ProcessStartInfo the_StartInfo;
                Process the_Process;
                try
                {
                    the_Reg = Registry.ClassesRoot.OpenSubKey(@"Applications\\WinRAR.exe\\Shell\\Open\\Command");
                    the_Obj = the_Reg.GetValue("");
                    the_rar = the_Obj.ToString();
                    the_Reg.Close();
                    the_rar = the_rar.Substring(1, the_rar.Length - 7);
                    if (!Directory.Exists(unRarPath + "\\" + rarName.Substring(0, rarName.LastIndexOf(".")-1)))
                        Directory.CreateDirectory(unRarPath + "\\" + rarName.Substring(0, rarName.LastIndexOf(".")-1));
                    the_Info = string.Format("x {0} {1}\\{2} -y", rarName, unRarPath, rarName.Substring(0, rarName.LastIndexOf(".")-1));
                    the_StartInfo = new ProcessStartInfo();
                    the_StartInfo.FileName = the_rar;
                    the_StartInfo.Arguments = the_Info;
                    the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                    the_StartInfo.WorkingDirectory = rarPath;//獲取壓縮包路徑

                    the_Process = new Process();
                    the_Process.StartInfo = the_StartInfo;
                    the_Process.Start();
                    the_Process.WaitForExit();
                    the_Process.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                return "";//Server.MapPath(unRarPatch);
            }
            public string unRAR(string rarPath, string rarName, string unRarPath, string unRarPathName)
            {
                String the_rar;
                RegistryKey the_Reg;
                Object the_Obj;
                String the_Info;
                ProcessStartInfo the_StartInfo;
                Process the_Process;
                try
                {
                    the_Reg = Registry.ClassesRoot.OpenSubKey(@"Applications\\WinRAR.exe\\Shell\\Open\\Command");
                    the_Obj = the_Reg.GetValue("");
                    the_rar = the_Obj.ToString();
                    the_Reg.Close();
                    the_rar = the_rar.Substring(1, the_rar.Length - 7);
                    //if (!Directory.Exists(unRarPath + "\\" + unRarPathName))
                    //    Directory.CreateDirectory(unRarPath + "\\" + unRarPathName);
                    //the_Info = string.Format("x {0} {1}\\{2} -y", rarName, unRarPath, unRarPathName);

                    if (!Directory.Exists(unRarPath ))
                        Directory.CreateDirectory(unRarPath);
                    the_Info = string.Format("x {0} {1} -y", rarName, unRarPath);
                    the_StartInfo = new ProcessStartInfo();
                    the_StartInfo.FileName = the_rar;
                    the_StartInfo.Arguments = the_Info;
                    the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                    the_StartInfo.WorkingDirectory = rarPath;//獲取壓縮包路徑

                    the_Process = new Process();
                    the_Process.StartInfo = the_StartInfo;
                    the_Process.Start();
                    the_Process.WaitForExit();
                    the_Process.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                return "";//Server.MapPath(unRarPatch);
            }

    RARsave("c:\\emrbs", "1.txt 2.txt", "c:\\test", "test.rar");

    unRAR("d:\\","f.rar","d:\\ftest");

    posted on 2009-12-28 17:14 sanmao 閱讀(757) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    常用鏈接

    留言簿(5)

    隨筆分類

    隨筆檔案

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 一级毛片不卡免费看老司机| 亚洲欧美日韩自偷自拍| 五月天国产成人AV免费观看| 好爽又高潮了毛片免费下载| 亚洲无人区视频大全| 国产免费丝袜调教视频| 亚洲三级在线观看| 蜜桃视频在线观看免费网址入口| 亚洲伊人久久大香线蕉在观| 无码囯产精品一区二区免费| 亚洲视频在线观看免费| 久久综合给合久久国产免费| 亚洲精品国产免费| 成人免费看吃奶视频网站| 99亚洲乱人伦aⅴ精品| 亚洲性日韩精品一区二区三区| 久久国产免费直播| 久久夜色精品国产噜噜噜亚洲AV| 精品无码国产污污污免费网站| 亚洲制服在线观看| 日韩成人免费aa在线看| 成人片黄网站色大片免费观看cn | 看成年女人免费午夜视频| 免费人成网站在线高清| 中国极品美軳免费观看| 水蜜桃亚洲一二三四在线| 国产黄色免费网站| 香港特级三A毛片免费观看| 伊人久久综在合线亚洲91| 日韩免费的视频在线观看香蕉| 亚洲理论在线观看| 免费看的黄色大片| 皇色在线免费视频| 亚洲日韩乱码中文无码蜜桃臀| 日本免费高清一本视频| 在线观看免费黄网站| 亚洲色无码国产精品网站可下载| 亚洲а∨天堂久久精品| 50岁老女人的毛片免费观看| 男女超爽视频免费播放| 亚洲一级二级三级不卡|