public SevenZipDLLInResource() { ExtractResourceToFile(Temp_dll_name); this.Handle = LoadLibrary(Temp_dll_name); this.SevenZipPtr = GetProcAddress(this.Handle, "SevenZip"); this.SevenZipMarshal = (SevenZipDelegate)Marshal.GetDelegateForFunctionPointer(SevenZipPtr, typeof(SevenZipDelegate)); }
public void Dispose() { if (this.Handle != IntPtr.Zero) { FreeLibrary(this.Handle); this.Handle = IntPtr.Zero; this.SevenZipPtr = IntPtr.Zero; this.SevenZipMarshal = null; } if (System.IO.File.Exists(Temp_dll_name)) { File.Delete(Temp_dll_name); } }