• HTML生成类


      1using System;
      2using System.Collections.Generic;
      3using System.Text;
      4using System.IO;
      5using System.Web;
      6/// <summary>
      7/// ====================
      8/// 作者:skyblue 带模板的HTML生成类 http://skyblue.cnblogs.com
      9/// 日期:2008-09-17
     10/// 版本:1.0.0
     11/// ====================
     12/// </summary>

     13namespace SkyBlue_HtmlMade
     14{
     15    /// <summary>
     16    /// HTML生成类
     17    /// </summary>

     18    public class MadeHtml
     19    {
     20        Members 成员
     88
     89        Contructors 构造
    126
    127        Methods 方法
    250    }

    251}

    252

    模版

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>生成试测</title>
        <style type="text/css">
        body
        {
        margin:0;
        padding:0;
        }
        .ContentDiv
        {
            float:left;
            border-top:solid 1px #000000;text-align:center;
            border-right:solid 1px #000000; 98px;
        }
        </style>
    </head>
    <body>
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="400">
    <tr>
    <td style="border-left:solid 1px #000000; "><div class="ContentDiv">一</div><div class="ContentDiv">一</div><div class="ContentDiv">一</div><div class="ContentDiv">一</div><div class="ContentDiv">一</div><div class="ContentDiv">一</div>
    <div class="ContentDiv">一</div>
    <div class="ContentDiv">一</div>
    <div class="ContentDiv">一</div>
    <div class="ContentDiv">一</div>
    <div class="ContentDiv">一</div>
    <div class="ContentDiv">一</div>
    <div class="ContentDiv">一</div>
    <div class="ContentDiv">一</div>
    <div style=" background-color:#000000;margin:0; padding:0; height:1px; 99%"></div>

    </td>
    </tr>
    </table>

    </body>

    </html>

     测式调用

           //<div class="ContentDiv">一</div>
            SkyBlue_HtmlMade.MadeHtml dal = new MadeHtml("Html/Template.htm", "html", "test.htm");
            string[] param ={ "$HtmlStr$" };
            string[] value ={ "<div class=""ContentDiv"">一</div><div class=""ContentDiv"">一</div><div class=""ContentDiv"">一</div><div class=""ContentDiv"">一</div><div class=""ContentDiv"">一</div><div class=""ContentDiv"">一</div>" };
            string flag= dal.HtmlWriting(param, value);
            Response.Write(flag);

  • 相关阅读:
    video全屏视频背景适配不同分辨率
    深入理解object.defineproperty()方法
    抓取之近似网页过滤
    基情四射的两个css样式
    Hadoop 2.4.1 登录认证配置小结
    Window中调试HBase问题小结
    改了改博客界面
    Hbase0.98.4/Hadoop2.4.1整合小结【原创】
    Hadoop 2.4.1 Map/Reduce小结【原创】
    hadoop的dfs工具类一个【原创】
  • 原文地址:https://www.cnblogs.com/skyblue/p/1292381.html
Copyright © 2020-2023  润新知