المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Display Assembly Resources in Web Browser (problem with jpg/pdf)



C# Programming
05-10-2009, 10:12 PM
Hello,
I have 3 types of resources embeded in my executable :
html, jpg and pdf. I also have a listbox, and I want whenever a user sleects a different item, to display it in a web browser.

I have no problems doing that to HTML files, but with the other one, it's a different thing and I hope someone can help me do this.
First, I want to say that I don't want to save the resources locally and after that load them in the browser, because I don't want users to see them.

I am using this to view the html :


Assembly assembly = Assembly.GetExecutingAssembly();
webBrowser1.DocumentStream = assembly.GetManifestResourceStream("ebook.index.html");

If I try to do the same thing to the pdf or jpg, it simply shows me the binary data of the files, it does not display them in the browser.
Is it possible to make the visible in the browser, directly from the assembly ? What are my options ?

Thank you