用c# 写的一个解压文件的程序 解压之后里面的文件不见了 贴上代码~
  string the_rar;
        RegistryKey the_Reg;
        object the_Obj;
        string the_Info;
        try
        {
            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();
            if (Directory.Exists(unRarPatch) == false)
            {
                Directory.CreateDirectory(unRarPatch);
            }

            the_Info = "x " + rarPatch +"\\"+ 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();

          new Normal_AdminlogsDAL().SaveMapServiceLog(unRarPatch + " ? " + rarPatch + " ? " + rarName );//Test  
          new Normal_AdminlogsDAL().SaveMapServiceLog(the_Info + " ? " + the_rar);//Test  
        }
        catch (Exception ex)
        {                
            new Normal_AdminlogsDAL().SaveMapServiceLog(" 解压发生异常:" + ex.Message);
        }

2个回答

你这个不是写了一个解压文件,只是简单调用了winrar,你看下你的参数对不对,先在命令行中运行下。

我发现,啥都看不懂。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问