This topic is locked
[SOLVED]

Using ZIP

2/2/2024 9:19:57 AM
ASPRunner.NET General questions
G
gluckett author

HI All,
I want to use the File Compression (zip) in the List Event

System.IO.Compression.ZipFile.CreateFromDirectory(directoryToArchivePath, archiveDestinationPath);

The type or namespace name 'ZipFile' does not exist in the namespace 'System.IO.Compression'

normally this works in standard .net... System.IO is available.

How do I add the System.IO.Compression namespace?

F
FR 2/2/2024

Create a class module that you store in source\include.

Say, AppUtils.cs.

In that file, add the namespace reference.

Write your methods there.

Invoke your methods from events, using AppUtils.MethodName();

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using System.Reflection;
using System.Net;

using System.IO.Compression;

using runnerDotNet;
namespace runnerDotNet

{
public class AppUtils
{

//--------------------------------------------------
// Methods
//--------------------------------------------------
public static bool MethodName()
{
...
}
}
}
G
gluckett author 2/5/2024

Thanks! That works well.