Free Support Forum - aspose.com

Problem using Excel(StreamReader- Page) constructor

I am trying to implement the StreamReader constructor for the excel component and am getting an ‘Message: The license is for a different product or corrupted. Source: Aspose.Excel’ exception.

The file method works perfactly!

I have compaired the contense of the StreamReader with the file and they are identical. Yet I get this error.

I am creating the stream reader with the following code:

ASCIIEncoding encoder = new System.Text.ASCIIEncoding();
string license = “XYZ”; // Real license removed
return new StreamReader(new MemoryStream(encoder.GetBytes(license)));

any Ideas!

Please change your encoding mode to UnicodeEncoding.UTF7 and have a try.

Thanks Laurance

Works fine now. I’ll go back to the docs, before posting in future…Embarrassed

You are welcome. Feel free to contact us if you have any questions.