C# 解压缩问题

childrenhi 2010-10-20 12:04:36
the_Reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe");
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(unRarPatch) == false)
{
Directory.CreateDirectory(unRarPatch);
}
//the_Info = "x " + rarName + " " + unRarPatch + " -y -ibck ";
the_Info = "x " + rarName + " " + unRarPatch + " -y ";
ProcessStartInfo the_StartInfo = new ProcessStartInfo();
the_StartInfo.FileName = the_rar;
the_StartInfo.Arguments = the_Info;
the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
the_StartInfo.WorkingDirectory = rarPatch;//获取压缩包路径

Process the_Process = new Process();
the_Process.StartInfo = the_StartInfo;
the_Process.Start();

the_Process.WaitForExit();
the_Process.Close();


网上的解压缩程序,运行通过,但是有时候不能解压出文件夹,这是什么问题呢?
...全文
143 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
childrenhi 2010-10-25
  • 打赏
  • 举报
回复
谢谢大家踊跃发言,原来路径有空格就会存在这个问题,问题解决。
huwen7565833 2010-10-20
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 hanqiujun0819 的回复:]
我再提一个问题哦,就是如何删除隐藏文件夹呢,注意不是隐藏文件,而是文件夹
[/Quote]
http://net-liu.javaeye.com/blog/693031
renyouprince 2010-10-20
  • 打赏
  • 举报
回复
每天回帖即可获得10分可用分!
huwen7565833 2010-10-20
  • 打赏
  • 举报
回复
ZIP文件的压缩和解压缩:http://net-liu.javaeye.com/blog/693179

Rar压缩和解压缩:http://net-liu.javaeye.com/blog/687280
childrenhi 2010-10-20
  • 打赏
  • 举报
回复
我再提一个问题哦,就是如何删除隐藏文件夹呢,注意不是隐藏文件,而是文件夹
childrenhi 2010-10-20
  • 打赏
  • 举报
回复
这个运行时没有错的,就是有时候就不解压成文件夹;把文件复制到另一个文件夹,就可以解压了,大家帮我想想什么问题呀
机器人 2010-10-20
  • 打赏
  • 举报
回复
用开源的SharpZipLib吧,如果目标机器上没有WinRAR怎么办?
Rock870210 2010-10-20
  • 打赏
  • 举报
回复
压缩文件的类型问题吧,有可能是rar、zip、7z等

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧