我有WinRAR SFX文件。我知道我可以使用以下代码提取存档:
Process process = new Process();
process.StartInfo.FileName = "unrar.exe";
process.StartInfo.Arguments = "x file.rar d:\myFolder";
process.Start();
process.WaitForExit(); 但是,当SFX文件知道密码时,如何提取它呢?
发布于 2014-06-19 03:57:45
可以使用-p作为参数。
假设你的密码是123456
Process process = new Process();
process.StartInfo.FileName = "unrar.exe";
process.StartInfo.Arguments = "x -p123456 file.rar d:\myFolder";
process.Start();
process.WaitForExit(); 发布于 2014-06-19 03:45:49
假设您的密码是mypassword,则需要将参数行更改为:
process.StartInfo.Arguments = @"x -pmypassword file.rar d:\myFolder";请注意,您不应该在密码之前在-p后面放一个空格--否则它会提示您。
我还添加了一个@来将字符串标记为文字,否则它将尝试将文件名中的\m视为转义字符。
https://stackoverflow.com/questions/24298372
复制相似问题