ASP.Net如何在浏览器中阅读电子书? [英] ASP.Net how to read ebooks in browser?

查看:114
本文介绍了ASP.Net如何在浏览器中阅读电子书?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!我只是个初学者。我正在尝试写关于'在线图书馆'的项目。

我知道如何使用FileUpload按钮。但我想知道如何阅读浏览器上的电子书,我也想知道如何下载电子书(我的意思是如何使用下载按钮)。谢谢。

Hi! I'm just a beginner. I'm trying to write about the 'Online Book Library' project.
I know how to user FileUpload button.But I want to know how to read ebooks on Browsers and I also want to know how to download the ebooks ( I mean how to use download button) . Thank You.

推荐答案

首先我想谈谈下载文件,在ASP.NET中,您可以使用以下代码让客户端下载文件。



First I would like to talk about downloading the files, in ASP.NET, you can use this following code to let the client download the file.

// Provided you wanted to share the name in the QueryString
var file = Server.MapPath("~/documents/" + Request["doc"]);
Response.AppendHeader("content-disposition", "attachment; filename=" + Request["doc"]);
Response.ContentType = "application/octet-stream";
// Transmit file
Response.TransmitFile(file);





然后,为了查看文件内容,有很多方法,如果文件是PDF,那么你需要使用一些PDF阅读器,如果文件是Word文档然后是Word阅读器。第三方开发人员有很多.NET库让你阅读这些文件的内容,并将它们作为简单的痛苦文本(但带有样式)写在屏幕上。其中一个库是 iTextSharp [ ^ ]。有类似的更多库可以让您查看文件的内容。如果您使用iTextSharp,那么以下链接可以帮助您。



http://stackoverflow.com/questions/2550796/reading-pdf-content-with-itextsharp-dll-in-vb -net-or-c-sharp [ ^ ]

http://www.schiffhauer.com/read-text-in-a-pdf-in-c-with-itextsharp/ [<一个href =http://www.schiffhauer.com/read-text-in-a-pdf-in-c-with-itextsharp/target =_ blanktitle =New Window> ^ ]

https://social.msdn.microsoft.com/forums/vstudio/en-US/420e524e-9e2a-4a0a-969d-42284f523f07/read-pdf-usin g-itextsharp [ ^ ]



还有很多其他库和解决方案。当你需要它时,请记住谷歌。 :)



Then, for viewing the file content there are a lot of methods, if the file is PDF, then you would need to use some PDF reader, if the file is Word document then a Word reader. There are quite a lot of .NET libraries by third-party developers to let you read the content of these files and write them on the screen as simple pain text (but with styles). One of such libraries is iTextSharp[^]. There are similar more libraries to let you view the content of files. If you would use iTextSharp, then the following links would help you out.

http://stackoverflow.com/questions/2550796/reading-pdf-content-with-itextsharp-dll-in-vb-net-or-c-sharp[^]
http://www.schiffhauer.com/read-text-in-a-pdf-in-c-with-itextsharp/[^]
https://social.msdn.microsoft.com/forums/vstudio/en-US/420e524e-9e2a-4a0a-969d-42284f523f07/read-pdf-using-itextsharp[^]

There are a lot of other libraries and solution out there. Do remember to Google for them when you need them. :)


这是一篇文章读它 [ ^ ]


这篇关于ASP.Net如何在浏览器中阅读电子书?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆