// Rar Conversion Through X++
static void rarconversion(Args _args)
{
{
WinAPI::shellExecute("C:\\Program Files\\WinRAR\\WinRAR.exe",
"a -afzip -df c:\\test.zip C:\\xls");
}
"a -afzip -df c:\\test.zip C:\\xls");
}
//C:\\PurchPurchaseOrderReport.pdf;
//c:\\code.txt
//c:\\code.txt
//
CodeAccessPermission perm;
System.Exception ex;
str filePath = @'C:\Temp\TestZipFolder';
str zipPath = @'C:\Temp\test.zip';
str extractPath = @'C:\Temp\UnZip';
try
{
perm = new InteropPermission(InteropKind::CLRInterop);
perm.assert();
//Archive folder content to file
System.IO.Compression.ZipFile::CreateFromDirectory(filePath, zipPath);
//extract Zip to folder
System.IO.Compression.ZipFile::ExtractToDirectory(zipPath, extractPath);
CodeAccessPermission::revertAssert();
}
catch (Exception::CLRError)
{
ex = ClrInterop::getLastException();
if (ex != null)
{
ex = ex.get_InnerException();
throw error(ex.ToString());
}
}
No comments:
Post a Comment