最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

c#調(diào)用winrar解壓縮文件代碼分享

 更新時間:2013年12月09日 09:28:17   作者:  
這篇文章主要介紹了c#調(diào)用winrar解壓縮文件的方法,大家參考使用吧

復制代碼 代碼如下:

using Microsoft.Win32;
using System.Diagnostics;
壓縮
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);
the_Info = " a " + " test.rar " + " " + @"C:\test\test.txt";
the_StartInfo = new ProcessStartInfo();


the_StartInfo.FileName = the_rar;
the_StartInfo.Arguments = the_Info;
the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
the_StartInfo.WorkingDirectory = @"C:\test\";
the_Process = new Process();
the_Process.StartInfo = the_StartInfo;
the_Process.Start();
Response.Write("<script>alert('Zip Successfully');</script>");
}
catch
{
Response.Write("<script>alert('Zip Failed.')</script>");
}

解壓縮

復制代碼 代碼如下:

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);
the_Info = " X " + " test.rar " + @"C:\test\";
the_StartInfo = new ProcessStartInfo();


the_StartInfo.FileName = the_rar;
the_StartInfo.Arguments = the_Info;
the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
the_StartInfo.WorkingDirectory = @"C:\test\";
the_Process = new Process();
the_Process.StartInfo = the_StartInfo;
the_Process.Start();
Response.Write("<script>alert('UnZip Successfully');</script>");
}
catch
{
Response.Write("<script>alert('UnZip Failed.')</script>");
}

相關文章

  • Unity制作自定義字體的兩種方法

    Unity制作自定義字體的兩種方法

    這篇文章主要為大家詳細介紹了Unity制作自定義字體的兩種方法,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-12-12
  • C#中DateTime函數(shù)的詳細用法

    C#中DateTime函數(shù)的詳細用法

    這篇文章介紹了C#中DateTime函數(shù)的詳細用法,文中通過示例代碼介紹的非常詳細。對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-06-06
  • C#之如何實現(xiàn)多個子窗體切換效果

    C#之如何實現(xiàn)多個子窗體切換效果

    這篇文章主要介紹了C#之如何實現(xiàn)多個子窗體切換的效果,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-07-07
  • C# Entity Framework中的IQueryable和IQueryProvider詳解

    C# Entity Framework中的IQueryable和IQueryProvider詳解

    這篇文章主要介紹了C# Entity Framework中的IQueryable和IQueryProvider詳解,本文使用實例分析這兩個接口的內(nèi)部實現(xiàn),需要的朋友可以參考下
    2015-01-01
  • 基于WPF實現(xiàn)驗證碼控件

    基于WPF實現(xiàn)驗證碼控件

    這篇文章主要介紹了如何利用WPF實現(xiàn)一個簡單的驗證碼控件,文中的示例代碼講解詳細,對我們學習或工作有一定幫助,需要的可以參考一下
    2022-08-08
  • C#關于Task.Yeild()函數(shù)的討論

    C#關于Task.Yeild()函數(shù)的討論

    這篇文章主要介紹了C#中關于Task.Yeild()函數(shù)的相關資料,文中講解非常細致,幫助大家更好的理解和學習,感興趣的朋友可以了解下
    2020-07-07
  • c#的dllimport使用方法詳解

    c#的dllimport使用方法詳解

    DllImport是System.Runtime.InteropServices命名空間下的一個屬性類,其功能是提供從非托管DLL導出的函數(shù)的必要調(diào)用信息
    2014-01-01
  • 關于WPF異步MVVM等待窗體的介紹

    關于WPF異步MVVM等待窗體的介紹

    本篇文章小編將為大家介紹,關于WPF異步MVVM等待窗體的介紹,需要的朋友參考下
    2013-04-04
  • Unity 通過LineRenderer繪制兩點之間的直線操作

    Unity 通過LineRenderer繪制兩點之間的直線操作

    這篇文章主要介紹了Unity 通過LineRenderer繪制兩點之間的直線操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2021-04-04
  • C# Task Cancellation使用總結(jié)

    C# Task Cancellation使用總結(jié)

    本文主要介紹了在使用CancellationTokenSource取消任務時的行為,以及如何使用Task的ContinueWith方法來處理任務的延續(xù)
    2024-12-12

最新評論

通海县| 霍城县| 外汇| 琼海市| 临泽县| 崇义县| 永清县| 肥东县| 娄底市| 香港| 望奎县| 五寨县| 怀来县| 乌兰浩特市| 陇西县| 新绛县| 新宾| 舟曲县| 资中县| 方城县| 临漳县| 织金县| 右玉县| 陆良县| 洪湖市| 汾阳市| 昌乐县| 黄平县| 西安市| 洮南市| 新兴县| 织金县| 蒲江县| 天水市| 北碚区| 曲麻莱县| 四子王旗| 富源县| 万山特区| 泸定县| 稻城县|