亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

c#調用winrar解壓縮文件代碼分享

 更新時間:2013年12月09日 09:28:17   作者:  
這篇文章主要介紹了c#調用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>");
}

相關文章

  • C# LINQ查詢表達式及對應LAMBDA表達式的用法

    C# LINQ查詢表達式及對應LAMBDA表達式的用法

    這篇文章主要介紹了C# LINQ查詢表達式及對應LAMBDA表達式的用法,幫助大家更好的理解和學習使用c#,感興趣的朋友可以了解下
    2021-04-04
  • c#后臺線程訪問前臺控件并顯示信息示例

    c#后臺線程訪問前臺控件并顯示信息示例

    這篇文章主要介紹了c#后臺線程訪問前臺控件并顯示信息示例,需要的朋友可以參考下
    2014-03-03
  • C#實現DVD借出歸還管理系統(tǒng)

    C#實現DVD借出歸還管理系統(tǒng)

    這篇文章主要介紹了C#實現DVD借出歸還管理系統(tǒng),類似DVD管理器,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-06-06
  • C#中System.Text.Json匿名對象反序列化

    C#中System.Text.Json匿名對象反序列化

    這篇文章主要介紹了System.Text.Json匿名對象反序列化,下文代碼基于. NET 6,為了代碼整潔,實際配置了PropertyNameCaseInsensitive = true,本文結合實例代碼介紹的非常詳細,需要的朋友可以參考下
    2023-05-05
  • C#處理datagridview虛擬模式的方法

    C#處理datagridview虛擬模式的方法

    這篇文章主要介紹了C#處理datagridview虛擬模式的方法,實例分析了C#中datagridview的使用技巧,需要的朋友可以參考下
    2015-06-06
  • C# Winform實現石頭剪刀布游戲

    C# Winform實現石頭剪刀布游戲

    這篇文章主要為大家詳細介紹了Winform實現石頭剪刀布游戲,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2019-01-01
  • C#中使用CliWrap讓命令行交互舉重若輕

    C#中使用CliWrap讓命令行交互舉重若輕

    這篇文章介紹了C#中使用CliWrap讓命令行交互舉重若輕,文中通過示例代碼介紹的非常詳細。對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2021-12-12
  • 使用C#實現網頁內容保存為圖片并生成壓縮包

    使用C#實現網頁內容保存為圖片并生成壓縮包

    這篇文章主要為大家詳細介紹了如何使用C#實現網頁內容保存為圖片并生成壓縮包,文中的示例代碼講解詳細,感興趣的小伙伴可以跟隨小編一起學習一下
    2024-02-02
  • C#獲得文件屬性信息的實現方法

    C#獲得文件屬性信息的實現方法

    這篇文章主要介紹了C#獲得文件屬性信息的實現方法,對于C#初學者了解與學習應用程序設計有一定的借鑒價值,需要的朋友可以參考下
    2014-07-07
  • 微信公眾號被動消息回復原理解析

    微信公眾號被動消息回復原理解析

    這篇文章主要介紹了公眾號被動消息回復原理解析,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下
    2019-06-06

最新評論