I added the code to my test program. Below I added the using directives that
I have in this class as well. I checked these against the samples for
SharpZipLib and they appear correct to me. Yet I get the following error:
(31): Cannot implicitly convert type '<error>' to 'System.IDisposable'
(31): The type or namespace name 'GzipInputStream' could not be found (are
you missing a using directive or an assembly reference?)
It is erroring on the following line of code:
using (Stream decompressedStream = new GzipInputStream(stream)
Specifically it doesn't seem to knwo what to do with
GzipInputStream
It's all done in memory. All you need is a single extra using block
between fetching the stream and passing it to a reader:
using System;
using System.Collections;
using System.IO;
using System.Reflection;
using Microsoft.Win32;
using ICSharpCode.SharpZipLib.GZip;
private void AddRestrictedSites()
{
using (Stream
stream=GetType().Assembly.GetManifestResourceStrea m("Build_Script.Sites.txt"
))
{
using (Stream decompressedStream = new GzipInputStream(stream))
{
using (StreamReader reader = new StreamReader(stream))
{
string line;
while ( (line=reader.ReadLine()) != null)
{
resourceSites.Add(line);
}
}
}
foreach(string x in resourceSites)
{
Console.WriteLine(x);
}
}//end