Notifications
Clear all

[Closed] Unzip a password file with dotnet,possible?

Hi,
I spent a whole day to find a way to unzip a password file from google,it seemed I am failed,I can use winzip or winrar to do it with command line in dos,then embed to maxscript,but I just want to know,if is it possible to unzip a password file using dotnet via maxscript directly?
There is a code sample can do it without password with Ionic.Utils.Zip.dll

dotNet.loadAssembly "C:\\Ionic.Utils.Zip.dll" --put the dll to your dir
Fn Extracts zipfilename targetDir =
(
	local zip = (dotNetClass "Ionic.Utils.Zip.ZipFile").Read(dotnetobject "system.string" zipfilename)
	for i = 0 to zip.count - 1 do
	(
		local z = zip.item[i]
		z.password="iampassword"  --your zip file with password -- "iampassword" --this part added by myself,not in origin example
		z.extract (dotNetObject "System.String" targetDir)		
	)
	true
)
Extracts "C:\	est.zip" "C:\\"

however,the result shows error:
>> MAXScript FileIn Exception: – Runtime error: dotNet runtime exception: The password did not match. <<
I am very sure the password is correct,even if use “1” as the password,also the same error,I don’t know why,is the dll version not correct?Or the code was wrong?
Or there has another way to do it?Any help would be thanks!
(I also upload the dll)