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

📄 weblog.cs

📁 基于C# .NET平台的网上帮助系统相关的类
💻 CS
字号:
//===========================================================
//==                (c)2007 24xN Inc.                      ==
//==         QQ:6458450,Email:qwsf01115@163.com            ==
//==               Site:http://www.24xn.com                ==
//==               论坛:http://bbs.24xn.com                ==
//==                  Code By Xi.Deng                      ==
//==                     版权所有                          ==
//===========================================================
using System;
using System.Configuration;
using System.Web;

    /// <summary>
    /// WebLog 的摘要说明
    /// </summary>
    public class WebLog
    {
        /// <summary>
        /// 页面错误提示信息
        /// </summary>
        /// <param name="ErrMsg">错误信息</param>
        /// <param name="Url">返回管理员地址  默认可以填写:""或"0"</param>
        public static void PageError(string ErrMsg, string Url)
        {
            PageRender(ErrMsg, Url, false);
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="StrUrl"></param>
        /// <returns></returns>
        private static string UserUrl(string StrUrl)
        {
            if (StrUrl == "0" || StrUrl == "")
            {
                StrUrl = "<a href='/'><b>返回首页</b></a>";
            }
            else
            {
                StrUrl = "<a href='" + StrUrl + "'><b>返回管理</b></a>";
            }
            return StrUrl;
        }

        /// <summary>
        /// 页面操作成功提示信息
        /// </summary>
        /// <param name="RightMsg">操作成功信息</param>
        /// <param name="Url">返回管理员地址</param>
        /// 更新时间2007-3-7
        public static void PageRight(string RightMsg, string Url)
        {
            PageRender(RightMsg, Url, true);
        }

        public static void PageRender(string Msg, string Url, bool Succeed)
        {
            string STitle = "操作成功信息";
            string _tmp = "<img src=\"../css/success.gif\" border=\"0\">";
            string SCaption = "√恭喜!操作成功";
            if (!Succeed)
            {
                STitle = "操作失败信息";
                _tmp = "<img src=\"../css/error.gif\" border=\"0\">";
                SCaption = "<font color=\"red\">×抱歉!操作失败</font>";
            }
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.Write("<html xmlns='http://www.w3.org/1999/xhtml' >\r<head>\r");
            HttpContext.Current.Response.Write("<title>" + STitle + "</title>\r");
            HttpContext.Current.Response.Write("<link href=\"../css/css.css\" rel=\"stylesheet\" type=\"text/css\" />\r");
            HttpContext.Current.Response.Write("\r</head><body>\r");
            HttpContext.Current.Response.Write("<table width='60%' border='0' align=\"center\" cellspacing=\"1\" cellpadding=\"5\" class=\"table\"  style=\"height:180px;margin-top:80px\"><tr class=\"hback\"><td class=\"hback\" style=\"height:38px;\" colspan=\"2\">" + SCaption + "</td>\r");
            HttpContext.Current.Response.Write("</tr><tr class=\"hback\"><td align=\"center\" style=\"40%\">" + _tmp + "<br /><br /></td><td class=\"list_link\" ><font color=red>操作描述:</font>\r");
            HttpContext.Current.Response.Write("<ul>");
            HttpContext.Current.Response.Write("<li><span>" + Msg + "</span></li><li><a href='javascript:history.back();' class='list_link'><b>返回继续操作</b></a>&nbsp;&nbsp;&nbsp;&nbsp;" + UserUrl(Url) + "</li><li>Powered by DengXi.</li></ul>\r");
            HttpContext.Current.Response.Write("    </td></tr>\r</table>\r");
            HttpContext.Current.Response.Write("</body>\r</html>\r");
            HttpContext.Current.Response.End();
        }
    }

⌨️ 快捷键说明

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