Default.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page 
{
    SqlHelper data = new SqlHelper();
    protected void Page_Load(object sender, EventArgs e)
    {
      
        if (!IsPostBack)
        {
            getAbot();
            dlNews.DataSource = data.GetDataReader("select top  5 * from  News where TypeName='新闻公告' order by  id desc ");
            dlNews.DataBind();
            dlXinDe.DataSource = data.GetDataReader("select top  5 * from  News where TypeName='教学大纲' order by  id desc ");
            dlXinDe.DataBind();
            DlZN.DataSource = data.GetDataReader("select top  5 * from  News where TypeName='课程习题' order by  id desc ");
            DlZN.DataBind();
            dlKC.DataSource = data.GetDataReader("select top  5 * from  News where TypeName='文献参考' order by  id desc ");
            dlKC.DataBind();

            DataList1.DataSource = data.GetDataReader("select top 12  * from  FileInfo  order by  id desc ");
            DataList1.DataBind();

            DataList2.DataSource = data.GetDataReader("select top  12 * from  Video   order by  id desc ");
            DataList2.DataBind();

            DataList3.DataSource = data.GetDataReader("select top 4 * from  Video   order by  Addtime asc  ");
            DataList3.DataBind();
        }

    }
    private void getAbot()
    {
        SqlDataReader dr;
        dr = data.GetDataReader("select top 1 * from  AboutInfo ");
        dr.Read();
        if (dr["AboutInfo"].ToString().Length > 170)
        {
            About.InnerHtml = dr["AboutInfo"].ToString().Substring(0, 170) + " ……<a href='About.aspx'>[详细]</a>";
        }
        else
        {
            About.InnerHtml = dr["AboutInfo"].ToString() + "<a href='About.aspx'>[详细]</a>";
        }
    }
    protected string CutChar(string strChar, int intLength)
    {
        //取得自定义长度的字符串
        if (strChar.Length > intLength)
        { return strChar.Substring(0, intLength); }
        else
        { return strChar; }
后面还有 4 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。