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

📄 index.aspx.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
字号:
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;
using NetCMS.Content;
using NetCMS.Content.Common;


public partial class User_index : NetCMS.Web.UI.UserPage
{ 
    user us = new user();
    UserMisc rd = new UserMisc();
    Channel crd = new Channel();
    public string URL = "main.aspx";
    public string ChannelList = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
        if (!IsPostBack)
        {
            isManage.InnerHtml = isManagestr();
            messageID.InnerHtml = messageChar();
            reURL();

            rootPublic rd = new rootPublic();
            string u_bUserName = rd.getUserName(NetCMS.Global.Current.UserNum);
            int isFriendNum = us.GetUncheckFriendsCount(u_bUserName);
            if (isFriendNum > 0)
            {
                isFriendPass.InnerHtml = "<a href=\"Requestinformation.aspx\" class=\"list_link\" target=\"sys_main\">(<span style=\"color:Red\" title=\"有" + isFriendNum + "个用户加你为好友,需要你验证\">" + isFriendNum + "</span>)</a>";
            }
            else
            {
                isFriendPass.InnerHtml = "(<span title=\"无需要验证的用户\">0</span>)";
            }
            ChannelList = GetModelMenu(0, 0, 0);
        }
    }

    protected string GetModelMenu(int ParentID, int Layer,int i)
    {
        string listchmenu = string.Empty;
        IDataReader drs = crd.getModelTemplet(ParentID);
        while (drs.Read())
        {
            int j = i;
            string stxt = "";
            if (Layer > 0)
            {
                stxt = "┞┄ ";
            }
            j++;
            if (drs["hashCount"].ToString() != "0")
            {
                listchmenu += "    linkset[5][" + j + "]='<div><a class=\"menu_ctr\" href=\"javascript:;\" title=\"有子频道不能添加文档\">" + stxt + drs["channelName"] + "</a></div>'\r";
                listchmenu += GetModelMenu(int.Parse(drs["ID"].ToString()), (Layer + 1), j);
            }
            else
            {
                listchmenu += "    linkset[5][" + j + "]='<div>" + stxt + "<a class=\"menu_ctr\" href=\"channel/list.aspx?ChID=" + drs["id"].ToString() + "\" target=\"sys_main\">" + drs["channelName"] + "</a></div>'\r";
            }
        }
        drs.Close();
        return listchmenu;
    }


    protected string getChannelList()
    {
        string liststr = string.Empty;
        IDataReader drs = crd.getModelTempletisConstr(0);
        int i = 0;
        while (drs.Read())
        {
            liststr += "    linkset[5][" + i + "]='<div><a class=\"menu_ctr\" href=\"channel/list.aspx?ChID="+drs["id"].ToString()+"\" target=\"sys_main\">" + drs["channelName"] + "</a></div>'\r";
            i++;
        }
        drs.Close();
        return liststr;
    }


    /// <summary>
    /// 获得转向参数
    /// </summary>
    protected void reURL()
    {
        string str_URL = Request.QueryString["urls"];
        if (str_URL != null && str_URL != "" && str_URL != string.Empty)
        {
            URL = str_URL.Replace("-------", "&");
        }
    }

    //protected void out_click(object sender, EventArgs e)
    //{
    //    Logout();
    //}

    /// <summary>
    /// 是否管理员
    /// </summary>
    /// <returns></returns>
    protected string isManagestr()
    {
        string _STR = "";
        //UserMisc rd = new UserMisc();
        //if (rd.getisAdmin() == 1)
        //{
        //    //_STR += "<a href=\"../" + NetCMS.Config.UIConfig.dirMana + "/index.aspx\" class=\"Lion_1\" target=\"_blank\">管理中心</a>&nbsp;&nbsp;┊";
        //}
        return _STR;
    }

    /// <summary>
    /// 是否有新消息
    /// </summary>
    /// <returns></returns>
    string messageChar()
    {
        string liststr = "";
        DataTable dt = rd.sel_Misc(NetCMS.Global.Current.UserNum,1);
        if (dt != null)
        {
            if (dt.Rows.Count > 0)
            {
                liststr += "<a href=\"../" + NetCMS.Config.UIConfig.dirUser + "/message/Message_box.aspx?Id=1\" class=\"tbie\" target=\"sys_main\">新短消息(" + dt.Rows.Count + ")</a><bgsound src=\"../sysImages/sound/newmessage.wav\" />";
            }
            else
            {
                liststr += "<a href=\"../" + NetCMS.Config.UIConfig.dirUser + "/message/Message_box.aspx?Id=1\"  class=\"Lion_1\" target=\"sys_main\">短消息(0)</a>";
            }
        }
        else
        {
            liststr += "<a href=\"../" + NetCMS.Config.UIConfig.dirUser + "/message/Message_box.aspx?Id=1\" class=\"Lion_1\" target=\"_self\">短消息(0)</a>";
        }
        return liststr;
    }
}

⌨️ 快捷键说明

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