⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 indexbusiness.cs

📁 内容管理 内容管理 内容管理 内容管理 内容管理
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


/// <summary>
/// IndexBusiness 的摘要说明
/// </summary>
public class IndexBusiness
{
    public IndexBusiness()
    {
        //
        // TODO: 在此处添加构造函数逻辑
        //
    }


    /// <summary>
    /// 返回留言板的HTML表字符传
    /// </summary>
    /// <param name="row"></param>
    /// <returns></returns>
    public static string MakeHTML(System.Data.DataRow row,string VirtualPath)
    {

        string MessageTime = System.Web.HttpContext.Current.Server.HtmlEncode(row["leavewordTime"].ToString());
        MessageTime = "留言时间: "+ MessageTime;
        string image = "<img src=" + VirtualPath + "/image/MessageBoard/userImage2.jpg width=100 height=100>";
        string name = System.Web.HttpContext.Current.Server.HtmlEncode(row["WebUser"].ToString());
        string Title = System.Web.HttpContext.Current.Server.HtmlEncode(row["Title"].ToString());
        Title = "留言标题:" + Title;
        string MessageContent = System.Web.HttpContext.Current.Server.HtmlEncode(row["Content"].ToString());
        string delID = row["id"].ToString();
        string noRevert = "";//为回复;
        //
        if (row["RevertContent"] == System.DBNull.Value)
        {
            noRevert = "[管理员尚未回复]";
        }
        else
        {
            noRevert = "[服务中心时间]: " + System.DateTime.Now + System.Web.HttpContext.Current.Server.HtmlEncode(row["RevertContent"].ToString());
        }

        if (AccessVariable.TopImage == "") //留言时间背景图片。
        {
            AccessVariable.TopImage = VirtualPath + "/image/MessageBoard/Titlebg1.jpg";
        }

        //表格宽度760
        string HTML;
        HTML = "<table  width=600 height=216 border=0 align=center cellpadding=0 cellspacing=0 bordercolor=#8ba81a style='BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid;  BORDER-BOTTOM: 1px solid;'>";
        HTML += "<tr align=center >";
        HTML += "<td colspan=2 background=" + AccessVariable.TopImage + "  height=24 style='  BORDER-BOTTOM: 1px solid;'>";
        //HTML += "<td colspan=2 height=24 style='  BORDER-BOTTOM: 1px solid;' >";
        //加一个table-------------------------------
        HTML += "<table width=590 height=22 border=0 cellpadding=0 cellspacing=0 >";
        HTML += "<tr>";
        HTML += "<td width=120 align=center></td>";
        //这里使用样式newsDate
        HTML += "<td width=470 align=center class=newsDate>" + MessageTime + "</td>";
        HTML += "</tr>";
        HTML += "</table> ";
        //'-------------------------------------------
        HTML += "</td>";
        HTML += "</tr>";
        HTML += "<tr>";
        HTML += "<td width=150 rowspan=4 align=center valign=middle bgcolor=#FFFFF2 style='BORDER-RIGHT: 1px solid;'><table width=160 height=114 border=0 align=center cellpadding=0 cellspacing=0>";
        HTML += "<tr>";
        HTML += "<td height=61 align=center>" + image + "</td>";
        HTML += "</tr>";
        HTML += "<tr>";
        HTML += "<td height=18 align=center class=newsContent>[留言者姓名]</td>";
        HTML += "</tr>";
        HTML += "<tr>";
        HTML += "<td height=13 align=center class=newsContent>" + name + "</td>";
        HTML += "</tr>";
        HTML += "</table></td>";
        //这里使用样式texts
        HTML += "<td width=450 height=25 bgcolor=#FFFFF2 style='BORDER-BOTTOM: 1px solid;' align=left class=newsContent>" + Title + "</td>";
        HTML += "</tr>";
        if (row["IsNominate"].ToString().ToLower() != "false")
        {
            HTML += "<tr>";
            HTML += "<td height=99 bgcolor=#FFFFF2 style='BORDER-BOTTOM: 1px solid;'align=left class=newsContent>" + MessageContent + "</td>";
            HTML += "</tr>";
        }
        else
        {
            HTML += "<tr>";
            HTML += "<td height=99 bgcolor=#FFFFF2 style='BORDER-BOTTOM: 1px solid;'align=left class=newsContent>此留言内容尚未通过审核或被管理员屏蔽!</td>";
            HTML += "</tr>";
        }
        HTML += "<tr>";
        HTML += "<td height=34  bgcolor=#FFFFF2 style='BORDER-BOTTOM: 1px solid;' align=left class=newsContent>" + noRevert + "</td>";
        HTML += "</tr>";
        HTML += "<tr>";
        HTML += "<td height=21>";
        //------------加一个table--------------------------------------------------
        HTML += "<table width=52 height=20 border=0 align=right cellpadding=0 cellspacing=0>";
        HTML += "<tr>";
        string mail = System.Web.HttpContext.Current.Server.HtmlEncode(row["WebUser"].ToString()) + "的email是:" + System.Web.HttpContext.Current.Server.HtmlEncode(row["email"].ToString());
       // string tel = System.Web.HttpContext.Current.Server.HtmlEncode(row["WebUser"].ToString()) + "的电话是:" + System.Web.HttpContext.Current.Server.HtmlEncode(row["telephone"].ToString());
        string IPAddress = System.Web.HttpContext.Current.Server.HtmlEncode(row["WebUser"].ToString()) + "的IP地址是:" + System.Web.HttpContext.Current.Server.HtmlEncode(row["ip"].ToString());

        HTML += "<td width=260> &nbsp;</td>";
        HTML += "<td width=41 align=center>&nbsp;</td>";
        HTML += "<td width=41 align=center><img src=" + VirtualPath + "/image/MessageBoard/mail.gif alt=" + mail + "></td>";
        HTML += "<td width=44 align=center><img src=" + VirtualPath + "/image/MessageBoard/tel.gif  ></td>";
        HTML += "<td width=37 align=center><img src=" + VirtualPath + "/image/MessageBoard/ip.gif alt=" + IPAddress + "></td>";

        HTML += "</tr>";
        HTML += "</table>";
        //-----------------------------------------
        HTML += "</td>";
        HTML += "</tr>";
        HTML += "</table>";
        HTML += "<br>";

        return HTML;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -