Solved

Opening Resource file into Filestream

Posted on 2013-06-17
1
359 Views
Last Modified: 2013-08-08
Hi,

I’ve added a file as a resource to a project.  The file is an Excel document.

I’m trying to use this within the ASPose Cells framework.  Their documentation states it can open a file from a file stream.  However I’m at a complete loss as to how to get from a resource to a file stream?

Does anybody have any snippets they could share?

Here is the code that I have:

//Create a Stream object
FileStream fstream = new FileStream("C:\\book1.xls", FileMode.Open);

//Creating a Workbook object, open the file from a Stream object
//that contains the content of file and it should support seeking
Workbook workbook = new Workbook(fstream);

Open in new window

0
Comment
Question by:andyw27
1 Comment
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 39252785
from http://www.aspose.com/docs/display/cellsnet/Opening+an+Excel+File:

//Opening an Excel file as a stream
FileStream fs = File.OpenRead("c:\\book1.xls");

//Loading the Excel file contents into the control from a stream
gridDesktop1.ImportExcelFile(fs);

//Closing stream
fs.Close();
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now