zoukankan      html  css  js  c++  java
  • word转html

     private void E_docx(string f_o)
            {
                //BLL.MedicalTypeBLL mdl = new BLL.MedicalTypeBLL();
                //HiddenField1.Value = mdl.D_Medicals(f_o).Rows[0]["MEDICAL_TEMPLET"].ToString();
                //Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass();
                //Type wordType = word.GetType();
                //Microsoft.Office.Interop.Word.Documents docs = word.Documents; // 打开文件   
                //Type docsType = docs.GetType();
                //object fileName = Server.MapPath("~/UploadImgs/") + mdl.D_Medicals(f_o).Rows[0]["MEDICAL_TEMPLET"].ToString();
                //Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true }); // 转换格式,另存为   
                //Type docType = doc.GetType();
                //Encoding code = Encoding.GetEncoding("gb2312");
                //string str = DateTime.Now.ToString("yyyyMMddHHmmss");
                //fileName = str + ".htm";
                //StreamWriter sw = new StreamWriter(Server.MapPath("htm/") + fileName, false, code);
                //sw.Close();
                //object saveFileName = Server.MapPath("htm/") + fileName;
                ////保存HTML  

                //docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatHTML });
                //// 退出 Word 
                //object saveChanges = System.Reflection.Missing.Value;
                //object originalFormat = System.Reflection.Missing.Value;
                //object routeDocument = System.Reflection.Missing.Value;
                //docs.Close(ref saveChanges, ref originalFormat, ref routeDocument);
                ////doc.Close(ref saveChanges, ref originalFormat, ref routeDocument);
                //wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);

                //FileStream tFile = File.Open(saveFileName.ToString(), FileMode.Open, FileAccess.Read);
                //StreamReader sr = new StreamReader(tFile, code);
                //StringBuilder sb = new StringBuilder(sr.ReadToEnd());
                //string subs = string.Empty;
                //int iBeginIndex = sb.ToString().IndexOf("<body");
                //int  iEndIndex = sb.ToString().LastIndexOf("</body>");
                //int see = sb.ToString().Length;
                //subs = sb.ToString().Substring(iBeginIndex, iEndIndex - iBeginIndex).Replace("<body", "<div");
                //subs = sb.ToString().Replace("</body>", "</div>");
                //subs = subs.Replace(str + ".files", "htm/" + str + ".files");
                //subs = subs.Replace("v:imagedata", "image");
                //int num1 = subs.ToLower().IndexOf("<table");
                //int num2 = subs.ToLower().LastIndexOf("</table>");
                //str1 = subs.Substring(0, num1);
                //str2 = subs.Substring(num2);

                //div1.InnerHtml = subs.ToString();

            }

  • 相关阅读:
    Solr与Lucene的区别
    查询如下课程平均成绩和及格率的百分数(用"1行"显示): 企业管理(001),马克思(002),OO&UML (003),数据库(004)
    按平均成绩从高到低显示所有学生的“数据库”、“企业管理”、“英语”三门的课程成绩,按如下形式显示: 学生ID,,数据库,企业管理,英语,有效课程数,有效平均分
    按各科平均成绩从低到高和及格率的百分数从高到低顺序
    设计模式
    查询各科成绩最高和最低的分:以如下形式显示:课程ID,最高分,最低分
    什么是Session共享?请举出使用场景
    vue中监听路由参数变化
    获取DOM元素到页面顶部的距离,亲测有效版本(转载)
    css页面滚动条出现时防止页面跳动的方法
  • 原文地址:https://www.cnblogs.com/110abcd/p/4580540.html
Copyright © 2011-2022 走看看