Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Need a way in c# .Net framework target 2.0 to extract passworded .7z or .uha!! (http://www.go4expert.com/forums/c-sharp-net-framework-target-20-extract-t22534/)

NightsEvil 25Jun2010 09:42

Need a way in c# .Net framework target 2.0 to extract passworded .7z or .uha!!
 
hi all, im relatively new to the programing game and i have this code that i love and it works perfect except on certain systems it uses passworded SFX archives created by 7-zip, it extracts it to the app data roaming then runs the software, waits for it to finish then deletes it, its for a disk defragment software but i feel like im loseing alot of compression since its a SFX also i heard that if i build/integrate the compression into my application that it would resolve the errors i get from time to time iv heard of a few solutions one being SevenZipSharp but i cant get it to work, any ways here is the current code i am using for the SFX's and please be patient with me as i am self-learning and ill try my best to understand:

Code:

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);

also note that the .WaitForExit(); which is CRUCIAL (if theres a better way let me know but i really like how it works)



All times are GMT +5.5. The time now is 01:21.