string sql = "select top 1 Documentbody from Annotation where ObjectId like '%" + thePrintTempalteGuid.ToString() + "%' and MimeType like '%htm%' order by CreatedOn desc";
                    DataTable theAnnotation = new BaseSql().ExecuteReturnDataTable(sql);
                    if (theAnnotation.Rows.Count < 1)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "nofile", "<script>alert('没有在打印模板中找到指定的模板,请将模板文件以附件形式上传到打印模板!');top.close();</script>");
                        return;
                    }
                    byte[] theHtmlFile = Convert.FromBase64String(theAnnotation.Rows[0]["DocumentBody"].ToString());
                    MemoryStream stream = new MemoryStream(theHtmlFile, 0, theHtmlFile.Length);
                    //从内存流里面将文件内容读出来
                    StreamReader reader = new StreamReader(stream, System.Text.Encoding.Default);
                    string theFileContext = reader.ReadToEnd();

相关文章:

  • 2021-10-05
  • 2021-09-07
  • 2021-09-07
  • 2021-09-07
  • 2022-02-21
  • 2021-08-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2021-12-12
  • 2021-09-07
相关资源
相似解决方案