ivこれを機能させるためにさまざまな方法を試しましたが、基本的に機能するようになりましたが、WaitForExit()を取得できません。ここで行うように動作する...では、これをsevenzipで動作するように変換するにはどうすればよいですか? 私はそれを動作させることができず、また、プログラムを使用しない限りアクセスできないように SFX にパスワードが設定されており、7z.DLL の追加に関しては、エラーが発生するため追加できません。
7za.dll への参照を追加できませんでした。ファイルにアクセスできること、および有効なアセンブリまたは COM コンポーネントであることを確認してください。
string tempFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
System.Diagnostics.Process defrag1 = System.Diagnostics.Process.Start(@"AusLogics_Defrag.exe", string.Format(" -o{0} -y -Pthisisthepass", tempFolder));
defrag1.WaitForExit();
string executableDirectoryName = Path.GetDirectoryName(Application.ExecutablePath);
System.Diagnostics.Process defrag2 = System.Diagnostics.Process.Start(tempFolder + "\\" + "AusLogics_Defrag" + "\\" + "DiskDefrag.exe", "");
defrag2.WaitForExit();
System.IO.Directory.Delete(tempFolder + "\\" + "AusLogics_Defrag", true);
新規: これは私がこれまでに持っているものですが、「7-zip ライブラリまたは内部 COM エラーを読み込めません! メッセージ: ライブラリの読み込みに失敗しました」というエラーが表示されます。
SevenZipExtractor.SetLibraryPath("7z.dll"); //no idea of this is needed or not
SevenZipCompressor.SetLibraryPath("7z.dll"); //no idea of this is needed or not
string tempFolder = Environment.GerFolderPath(Environment.SpecialFolder.ApplicationData);
SevenZipExtractor defrag = new SevenZipExtractor(@"Programs\Optimize\Auslogics_Defrag.7z");
defrag.ExtracArchive(string.Format("-o{0} -y -PThisisthepass", tempFolder));