C在線壓縮與解壓_第1頁
C在線壓縮與解壓_第2頁
C在線壓縮與解壓_第3頁
C在線壓縮與解壓_第4頁
C在線壓縮與解壓_第5頁
已閱讀5頁,還剩1頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、1.ÒýÓÃusing System.IO;using Microsoft.Win32;using System.Diagnostics;/* ³ÌÐòÓÃ;:ʵÏÖÎļþÎļþ¼ÐѹËõ½âѹ¹¦ÄÜ

2、86;¯Êý³ÌÐò±¸×¢: * ·þÎñÆ÷¶ËWinRARÖ§³Ö * ·¾¶¼òÊö±ØÐë¾ø¶Ô·¾¶*/2.Ö÷Ò

3、0;´úÂë֮ѹËõ / <summary> / ѹËõÎļþ / </summary> / <param name="DFilePath">ÐèҪѹËõµÄÎļþ¼Ð»ò

4、;Õßµ¥¸öÎļþ</param> / <param name="DRARName">Éú³ÉѹËõÎļþµÄÎļþÃû</param> / <param name="DRARPath">É&

5、#250;³ÉѹËõÎļþ±£´æ·¾¶</param> / <returns></returns> protected bool RAR(string DFilePath, string DRARName,string DRARPath) String the_rar; RegistryKey the_Reg; Object the_Obj; String the_Info

6、; ProcessStartInfo the_StartInfo; Process the_Process; try the_Obj = the_Reg.GetValue(""); the_rar = the_Obj.ToString(); the_Reg.Close(); the_rar = the_rar.Substring(1, the_rar.Length - 7); the_Info = " a " + " " + DRARName + " " + DFilePath; /Ãü

7、3;î + ѹËõºóÎļþÃû + ±»Ñ¹ËõµÄÎļþ»òÕß·¾¶ the_StartInfo = new ProcessStartInfo(); the_StartInfo.FileName = the_rar; the_StartInfo.Argum

8、ents = the_Info; the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden; the_StartInfo.WorkingDirectory = DRARPath ; /RaRÎļþµÄ´æ·ÅĿ¼¡£ the_Process = new Process(); the_Process.StartInfo = the_StartInfo; the_Process.Sta

9、rt(); return true; catch (Exception ex) return false; 3.Ö÷Òª´úÂëÖ®½âѹ / <summary> / ½âѹËõµ½Ö¸¶¨Îļþ¼Ð / </summary> / <param

10、 name="RARFilePath">ѹËõÎļþ´æÔÚµÄĿ¼ </param> / <param name="RARFileName">ѹËõÎļþÃû³Æ </param> / <param

11、 name="UnRARFilePath">½âѹµ½Îļþ¼Ð</param> / <returns></returns> protected bool UnRAR(string RARFilePath,string RARFileName,string UnRARFilePath) /½âѹËõ String the_rar; RegistryK

12、ey the_Reg; Object the_Obj; String the_Info; ProcessStartInfo the_StartInfo; Process the_Process; try the_Obj = the_Reg.GetValue(""); the_rar = the_Obj.ToString(); the_Reg.Close(); the_rar = the_rar.Substring(1, the_rar.Length - 7); the_Info = " X " + " " + RARFilePath

13、+ RARFileName + " " + UnRARFilePath; the_StartInfo = new ProcessStartInfo(); the_StartInfo.FileName = the_rar; the_StartInfo.Arguments = the_Info; the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden; the_Process = new Process(); the_Process.StartInfo = the_StartInfo; the_Process.Start();

14、 return true; catch (Exception ex) return false; 3.ʾÀý string oFilePath = "C:1" string oRARFileName = "1.rar" string oToFilePath = "C:2" /if (RAR(oFilePath, oRARFileName, oToFilePath) if (UnRAR(oFilePath, oRARFileName, oToFilePath) Response.Write(&q

15、uot;OK"); else Response.Write("No"); 1.ÒýÓÃusing System.IO;using Microsoft.Win32;using System.Diagnostics;/* ³ÌÐòÓÃ;:ʵÏÖÎļþÎļþ¼ÐѹËõ

16、;½âѹ¹¦Äܺ¯Êý³ÌÐò±¸×¢: * ·þÎñÆ÷¶ËWinRARÖ§³Ö * ·¾¶¼òÊö±ØÐë¾ø¶

17、2;·¾¶*/2.Ö÷Òª´úÂë֮ѹËõ / <summary> / ѹËõÎļþ / </summary> / <param name="DFilePath">ÐèҪѹËõµ&

18、#196;Îļþ¼Ð»òÕßµ¥¸öÎļþ</param> / <param name="DRARName">Éú³ÉѹËõÎļþµÄÎļþÃû</param&

19、gt; / <param name="DRARPath">Éú³ÉѹËõÎļþ±£´æ·¾¶</param> / <returns></returns> protected bool RAR(string DFilePath, string DRARName,string DRARPath) String the_rar;

20、RegistryKey the_Reg; Object the_Obj; String the_Info; ProcessStartInfo the_StartInfo; Process the_Process; try the_Obj = the_Reg.GetValue(""); the_rar = the_Obj.ToString(); the_Reg.Close(); the_rar = the_rar.Substring(1, the_rar.Length - 7); the_Info = " a " + " " + DRA

21、RName + " " + DFilePath; /ÃüÁî + ѹËõºóÎļþÃû + ±»Ñ¹ËõµÄÎļþ»òÕß·¾¶ the_StartInfo = new ProcessStartInfo(); t

22、he_StartInfo.FileName = the_rar; the_StartInfo.Arguments = the_Info; the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden; the_StartInfo.WorkingDirectory = DRARPath ; /RaRÎļþµÄ´æ·ÅĿ¼¡£ the_Process = new Process(); th

23、e_Process.StartInfo = the_StartInfo; the_Process.Start(); return true; catch (Exception ex) return false; 3.Ö÷Òª´úÂëÖ®½âѹ / <summary> / ½âѹËõµ½Ö¸¶¨ÎÄ

24、88;þ¼Ð / </summary> / <param name="RARFilePath">ѹËõÎļþ´æÔÚµÄĿ¼ </param> / <param name="RARFileName">ѹËõÎļþ

25、;Ãû³Æ </param> / <param name="UnRARFilePath">½âѹµ½Îļþ¼Ð</param> / <returns></returns> protected bool UnRAR(string RARFilePath,string RARFileName,string UnRARFilePath) /½âѹËõ String the_rar; RegistryKey the_Reg; Object the_Obj; String the_Info; ProcessStartInfo the_StartInfo; Process the_Process; try

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論