2013-09-26 21 views
0

我正在求職門戶網站上工作。在那裏,我有求職者註冊表單。在那個求職者上傳resume.I保存只有簡歷文件名在數據庫和本地文件夾中的實際履歷。在另一個網絡表單中,我想顯示在div標籤中的簡歷,就像在naukri.com的更新/查看配置文件。所以我怎麼能做到這一點? 我可以從數據庫中檢索簡歷文件名。 所以,請任何人建議我任何解決方案。 在此先感謝。如何在asp.net中以web表單的形式顯示word文件

回答

0
// How to: Create a new package as a Word document. 
public static void CreateNewWordDocument(string document) 
{ 
    using (WordprocessingDocument wordDoc = WordprocessingDocument.Create(document, WordprocessingDocumentType.Document)) 
    { 
     // Set the content of the document so that Word can open it. 
     MainDocumentPart mainPart = wordDoc.AddMainDocumentPart(); 

     SetMainDocumentContent(mainPart); 
    } 
} 

// Set content of MainDocumentPart. 
public static void SetMainDocumentContent(MainDocumentPart part) 
{ 
    const string docXml = 
@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?> 
<w:document xmlns:w=""http://schemas.openxmlformats.org/wordprocessingml/2006/main""> 
    <w:body><w:p><w:r><w:t>Hello world!</w:t></w:r></w:p></w:body> 
</w:document>"; 

    using (Stream stream = part.GetStream()) 
    { 
     byte[] buf = (new UTF8Encoding()).GetBytes(docXml); 
     stream.Write(buf, 0, buf.Length); 
    } 
} 

here

另一個不錯的教程接過從here

相關問題