how to show docxfile of database into my webpage?

2020-04-19 19:51发布

问题:

i have a database.i am saving my files path in the database..my filespath is in my hard drive..now i want to show my docxfile in my webpages..in my docxfile there may be some tables,may be any pictures..most wiil be some text in a big table..i want to show the data in my webpages same as the docxfile..how to do it??can anyone give me any suggestion??i am using asp.net with c#...

i have seen here some code to read data from file..but don't know whether it will show the tables where the data is inside like text....

@{
var dataFile = Server.MapPath("~/App_Data/Persons.txt");
Array userData = File.ReadAllLines(dataFile);
}

<!DOCTYPE html>
<html>
<body>

<h1>Reading Data from a File</h1>
@foreach (string dataLine in userData) 
{
foreach (string dataItem in dataLine.Split(',')) 
{
@dataItem <text>&nbsp;</text>}
<br>
}

</body>